-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade amoc_rest with new openapi gens and enforce OTP27 #5
Conversation
a6c92c2
to
e1ebdaf
Compare
e1ebdaf
to
cde9151
Compare
get_documentation(Scenario) -> | ||
case code:get_doc(Scenario) of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of my favourite things of upgrading to OTP27, docs are embedded on the module now.
cde9151
to
5c9d8a4
Compare
5c9d8a4
to
95a4a10
Compare
test/amoc_api_helper.erl
Outdated
@@ -55,7 +60,8 @@ patch(BaseUrl, Path, Body) -> | |||
|
|||
-spec request(string(), binary(), binary()) -> | |||
{integer(), json()}. | |||
request(BaseUrl, Path, Method) -> request(BaseUrl, Path, Method, <<"">>). | |||
request(BaseUrl, Path, Method) -> | |||
request(BaseUrl, Path, Method, <<"">>). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request(BaseUrl, Path, Method, <<"">>). | |
request(BaseUrl, Path, Method, <<>>). |
test/amoc_api_helper.erl
Outdated
@@ -42,11 +45,13 @@ put(BaseUrl, Path, Body) -> | |||
|
|||
-spec patch(string()) -> | |||
{integer(), json()}. | |||
patch(Path) -> patch(get_url(), Path, <<"">>). | |||
patch(Path) -> | |||
patch(get_url(), Path, <<"">>). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patch(get_url(), Path, <<"">>). | |
patch(get_url(), Path, <<>>). |
95a4a10
to
1062fcd
Compare
1062fcd
to
c6f6fe0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍🏻
To merge after esl/amoc_rest#11
After integrating the new generated code, there's a couple of differences, mostly as we enforce OTP27:
json
, we don't need anyjsx
/jiffy
/other, and it's also the fastest. The generated code also allow us to distinguish between HTTP calls withcontent-type: application/json
vs others, see the pattern-matching clauses onaccept_callback/4
.code:get_doc/1
, documentation chunks are now embedded in the module and can be extracted and read at runtime, hence we can rid ofdocsh
.