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
|
samples/client/petstore/groovy/build
|
||||||
|
|
||||||
# erlang
|
# 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/_build/
|
||||||
samples/server/petstore/erlang-server/rebar.lock
|
samples/server/petstore/erlang-server/rebar.lock
|
||||||
|
@ -74,8 +74,8 @@ update_params_with_auth(Cfg, Headers, QS) ->
|
|||||||
AuthSettings = maps:get(auth, Cfg, #{}),
|
AuthSettings = maps:get(auth, Cfg, #{}),
|
||||||
Auths = #{ {{#authMethods}}'{{name}}' =>
|
Auths = #{ {{#authMethods}}'{{name}}' =>
|
||||||
#{type => '{{type}}',
|
#{type => '{{type}}',
|
||||||
key => <<"{{keyParamName}}">>,
|
key => <<"{{#isApiKey}}{{keyParamName}}{{/isApiKey}}{{^isApiKey}}Authorization{{/isApiKey}}">>,
|
||||||
in => {{#isKeyInHeader}}header{{/isKeyInHeader}}{{#isKeyInQuery}}query{{/isKeyInQuery}}}{{#hasMore}}, {{/hasMore}}{{/authMethods}}},
|
in => {{^isApiKey}}header{{/isApiKey}}{{#isKeyInHeader}}header{{/isKeyInHeader}}{{#isKeyInQuery}}query{{/isKeyInQuery}}}{{#hasMore}}, {{/hasMore}}{{/authMethods}}},
|
||||||
|
|
||||||
maps:fold(fun(AuthName, #{type := _Type,
|
maps:fold(fun(AuthName, #{type := _Type,
|
||||||
in := In,
|
in := In,
|
||||||
|
@ -86,7 +86,7 @@ place_order(Ctx, PetstoreOrder, Optional) ->
|
|||||||
QS = [],
|
QS = [],
|
||||||
Headers = [],
|
Headers = [],
|
||||||
Body1 = PetstoreOrder,
|
Body1 = PetstoreOrder,
|
||||||
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
||||||
Opts = maps:get(hackney_opts, Optional, []),
|
Opts = maps:get(hackney_opts, Optional, []),
|
||||||
|
|
||||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
@ -27,7 +27,7 @@ create_user(Ctx, PetstoreUser, Optional) ->
|
|||||||
QS = [],
|
QS = [],
|
||||||
Headers = [],
|
Headers = [],
|
||||||
Body1 = PetstoreUser,
|
Body1 = PetstoreUser,
|
||||||
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
||||||
Opts = maps:get(hackney_opts, Optional, []),
|
Opts = maps:get(hackney_opts, Optional, []),
|
||||||
|
|
||||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
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 = [],
|
QS = [],
|
||||||
Headers = [],
|
Headers = [],
|
||||||
Body1 = PetstoreUserArray,
|
Body1 = PetstoreUserArray,
|
||||||
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
||||||
Opts = maps:get(hackney_opts, Optional, []),
|
Opts = maps:get(hackney_opts, Optional, []),
|
||||||
|
|
||||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
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 = [],
|
QS = [],
|
||||||
Headers = [],
|
Headers = [],
|
||||||
Body1 = PetstoreUserArray,
|
Body1 = PetstoreUserArray,
|
||||||
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
||||||
Opts = maps:get(hackney_opts, Optional, []),
|
Opts = maps:get(hackney_opts, Optional, []),
|
||||||
|
|
||||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
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 = [],
|
QS = [],
|
||||||
Headers = [],
|
Headers = [],
|
||||||
Body1 = PetstoreUser,
|
Body1 = PetstoreUser,
|
||||||
ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]),
|
ContentTypeHeader = petstore_utils:select_header_content_type([]),
|
||||||
Opts = maps:get(hackney_opts, Optional, []),
|
Opts = maps:get(hackney_opts, Optional, []),
|
||||||
|
|
||||||
petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
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">>,
|
key => <<"api_key">>,
|
||||||
in => header}, 'petstore_auth' =>
|
in => header}, 'petstore_auth' =>
|
||||||
#{type => 'oauth2',
|
#{type => 'oauth2',
|
||||||
key => <<"">>,
|
key => <<"Authorization">>,
|
||||||
in => }},
|
in => header}},
|
||||||
|
|
||||||
maps:fold(fun(AuthName, #{type := _Type,
|
maps:fold(fun(AuthName, #{type := _Type,
|
||||||
in := In,
|
in := In,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user