forked from loafle/openapi-generator-original
fix erlang client compilation error (#228)
This commit is contained in:
parent
df26bcb40c
commit
bcc7b788e0
2
.gitignore
vendored
2
.gitignore
vendored
@ -193,5 +193,7 @@ samples/client/petstore/elixir/mix.lock
|
||||
samples/client/petstore/groovy/build
|
||||
|
||||
# erlang
|
||||
samples/client/petstore/erlang-client/_build/
|
||||
samples/client/petstore/erlang-client/rebar.lock
|
||||
samples/server/petstore/erlang-server/_build/
|
||||
samples/server/petstore/erlang-server/rebar.lock
|
||||
|
@ -74,8 +74,8 @@ update_params_with_auth(Cfg, Headers, QS) ->
|
||||
AuthSettings = maps:get(auth, Cfg, #{}),
|
||||
Auths = #{ {{#authMethods}}'{{name}}' =>
|
||||
#{type => '{{type}}',
|
||||
key => <<"{{keyParamName}}">>,
|
||||
in => {{#isKeyInHeader}}header{{/isKeyInHeader}}{{#isKeyInQuery}}query{{/isKeyInQuery}}}{{#hasMore}}, {{/hasMore}}{{/authMethods}}},
|
||||
key => <<"{{#isApiKey}}{{keyParamName}}{{/isApiKey}}{{^isApiKey}}Authorization{{/isApiKey}}">>,
|
||||
in => {{^isApiKey}}header{{/isApiKey}}{{#isKeyInHeader}}header{{/isKeyInHeader}}{{#isKeyInQuery}}query{{/isKeyInQuery}}}{{#hasMore}}, {{/hasMore}}{{/authMethods}}},
|
||||
|
||||
maps:fold(fun(AuthName, #{type := _Type,
|
||||
in := In,
|
||||
|
@ -86,7 +86,7 @@ place_order(Ctx, PetstoreOrder, Optional) ->
|
||||
QS = [],
|
||||
Headers = [],
|
||||
Body1 = PetstoreOrder,
|
||||
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
||||
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
||||
Opts = maps:get(hackney_opts, Optional, []),
|
||||
|
||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||
|
@ -27,7 +27,7 @@ create_user(Ctx, PetstoreUser, Optional) ->
|
||||
QS = [],
|
||||
Headers = [],
|
||||
Body1 = PetstoreUser,
|
||||
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
||||
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
||||
Opts = maps:get(hackney_opts, Optional, []),
|
||||
|
||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||
@ -48,7 +48,7 @@ create_users_with_array_input(Ctx, PetstoreUserArray, Optional) ->
|
||||
QS = [],
|
||||
Headers = [],
|
||||
Body1 = PetstoreUserArray,
|
||||
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
||||
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
||||
Opts = maps:get(hackney_opts, Optional, []),
|
||||
|
||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||
@ -69,7 +69,7 @@ create_users_with_list_input(Ctx, PetstoreUserArray, Optional) ->
|
||||
QS = [],
|
||||
Headers = [],
|
||||
Body1 = PetstoreUserArray,
|
||||
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
||||
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
||||
Opts = maps:get(hackney_opts, Optional, []),
|
||||
|
||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||
@ -174,7 +174,7 @@ update_user(Ctx, Username, PetstoreUser, Optional) ->
|
||||
QS = [],
|
||||
Headers = [],
|
||||
Body1 = PetstoreUser,
|
||||
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
||||
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
||||
Opts = maps:get(hackney_opts, Optional, []),
|
||||
|
||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||
|
@ -77,8 +77,8 @@ update_params_with_auth(Cfg, Headers, QS) ->
|
||||
key => <<"api_key">>,
|
||||
in => header}, 'petstore_auth' =>
|
||||
#{type => 'oauth2',
|
||||
key => <<"">>,
|
||||
in => }},
|
||||
key => <<"Authorization">>,
|
||||
in => header}},
|
||||
|
||||
maps:fold(fun(AuthName, #{type := _Type,
|
||||
in := In,
|
||||
|
Loading…
x
Reference in New Issue
Block a user