mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
* fix (partially) #4898 for Elixir * Update petstore samples (after fix for elixir for #4898)
This commit is contained in:
parent
090d80b42c
commit
d3f365fd29
@ -13,10 +13,10 @@ defmodule {{#modulized}}{{appName}}{{/modulized}}.Api.{{classname}} do
|
||||
def {{#underscored}}{{operationId}}{{/underscored}}({{#allParams}}{{^-first}}, {{/-first}}{{#underscored}}{{paramName}}{{/underscored}}{{/allParams}}) do
|
||||
method = [method: :{{#underscored}}{{httpMethod}}{{/underscored}}]
|
||||
url = [url: "{{replacedPathName}}"]
|
||||
query_params = [{{^queryParams.isEmpty}}query: [{{#queryParams}}{{^-first}}, {{/-first}}{:"{{paramName}}", {{#underscored}}{{paramName}}{{/underscored}}}{{/queryParams}}]{{/queryParams.isEmpty}}]
|
||||
header_params = [{{^headerParams.isEmpty}}header: [{{#headerParams}}{{^-first}}, {{/-first}}{:"{{paramName}}", {{#underscored}}{{paramName}}{{/underscored}}}{{/headerParams}}]{{/headerParams.isEmpty}}]
|
||||
query_params = [{{^queryParams.isEmpty}}query: [{{#queryParams}}{{^-first}}, {{/-first}}{:"{{baseName}}", {{#underscored}}{{paramName}}{{/underscored}}}{{/queryParams}}]{{/queryParams.isEmpty}}]
|
||||
header_params = [{{^headerParams.isEmpty}}header: [{{#headerParams}}{{^-first}}, {{/-first}}{:"{{baseName}}", {{#underscored}}{{paramName}}{{/underscored}}}{{/headerParams}}]{{/headerParams.isEmpty}}]
|
||||
body_params = [{{^bodyParams.isEmpty}}body: {{#bodyParams}}{{#underscored}}{{paramName}}{{/underscored}}{{/bodyParams}}{{/bodyParams.isEmpty}}]
|
||||
form_params = [{{^formParams.isEmpty}}body: Enum.map_join([{{#formParams}}{{^-first}}, {{/-first}}{:"{{paramName}}", {{#underscored}}{{paramName}}{{/underscored}}}{{/formParams}}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}")){{/formParams.isEmpty}}]
|
||||
form_params = [{{^formParams.isEmpty}}body: Enum.map_join([{{#formParams}}{{^-first}}, {{/-first}}{:"{{baseName}}", {{#underscored}}{{paramName}}{{/underscored}}}{{/formParams}}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}")){{/formParams.isEmpty}}]
|
||||
params = query_params ++ header_params ++ body_params ++ form_params
|
||||
opts = []
|
||||
options = method ++ url ++ params ++ opts
|
||||
|
@ -28,7 +28,7 @@ defmodule SwaggerPetstore.Api.Fake do
|
||||
query_params = []
|
||||
header_params = []
|
||||
body_params = []
|
||||
form_params = [body: Enum.map_join([{:"integer", integer}, {:"int32", int32}, {:"int64", int64}, {:"number", number}, {:"float", float}, {:"double", double}, {:"string", string}, {:"patternWithoutDelimiter", pattern_without_delimiter}, {:"byte", byte}, {:"binary", binary}, {:"date", date}, {:"dateTime", date_time}, {:"password", password}, {:"callback", callback}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}"))]
|
||||
form_params = [body: Enum.map_join([{:"integer", integer}, {:"int32", int32}, {:"int64", int64}, {:"number", number}, {:"float", float}, {:"double", double}, {:"string", string}, {:"pattern_without_delimiter", pattern_without_delimiter}, {:"byte", byte}, {:"binary", binary}, {:"date", date}, {:"dateTime", date_time}, {:"password", password}, {:"callback", callback}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}"))]
|
||||
params = query_params ++ header_params ++ body_params ++ form_params
|
||||
opts = []
|
||||
options = method ++ url ++ params ++ opts
|
||||
@ -39,10 +39,10 @@ defmodule SwaggerPetstore.Api.Fake do
|
||||
def test_enum_parameters(enum_form_string_array, enum_form_string, enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double) do
|
||||
method = [method: :get]
|
||||
url = [url: "/fake"]
|
||||
query_params = [query: [{:"enumQueryStringArray", enum_query_string_array}, {:"enumQueryString", enum_query_string}, {:"enumQueryInteger", enum_query_integer}]]
|
||||
header_params = [header: [{:"enumHeaderStringArray", enum_header_string_array}, {:"enumHeaderString", enum_header_string}]]
|
||||
query_params = [query: [{:"enum_query_string_array", enum_query_string_array}, {:"enum_query_string", enum_query_string}, {:"enum_query_integer", enum_query_integer}]]
|
||||
header_params = [header: [{:"enum_header_string_array", enum_header_string_array}, {:"enum_header_string", enum_header_string}]]
|
||||
body_params = []
|
||||
form_params = [body: Enum.map_join([{:"enumFormStringArray", enum_form_string_array}, {:"enumFormString", enum_form_string}, {:"enumQueryDouble", enum_query_double}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}"))]
|
||||
form_params = [body: Enum.map_join([{:"enum_form_string_array", enum_form_string_array}, {:"enum_form_string", enum_form_string}, {:"enum_query_double", enum_query_double}], "&", &("#{elem(&1, 0)}=#{elem(&1, 1)}"))]
|
||||
params = query_params ++ header_params ++ body_params ++ form_params
|
||||
opts = []
|
||||
options = method ++ url ++ params ++ opts
|
||||
|
@ -26,7 +26,7 @@ defmodule SwaggerPetstore.Api.Pet do
|
||||
method = [method: :delete]
|
||||
url = [url: "/pet/#{pet_id}"]
|
||||
query_params = []
|
||||
header_params = [header: [{:"apiKey", api_key}]]
|
||||
header_params = [header: [{:"api_key", api_key}]]
|
||||
body_params = []
|
||||
form_params = []
|
||||
params = query_params ++ header_params ++ body_params ++ form_params
|
||||
|
Loading…
Reference in New Issue
Block a user