diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index 5ae204450b36..f66a51fdfb95 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -44,9 +44,11 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; -public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig { +public class ElixirClientCodegen extends DefaultCodegen { private final Logger LOGGER = LoggerFactory.getLogger(ElixirClientCodegen.class); + private final Pattern simpleAtomPattern = Pattern.compile("\\A(?:(?:[_@\\p{Alpha}][_@\\p{Alnum}]*[?!]?)|-)\\z"); + protected String apiVersion = "1.0.0"; protected String moduleName; protected static final String defaultModuleName = "OpenAPI.Client"; @@ -54,11 +56,12 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig // This is the name of elixir project name; protected static final String defaultPackageName = "openapi_client"; - String supportedElixirVersion = "1.6"; + String supportedElixirVersion = "1.10"; List extraApplications = Arrays.asList(":logger"); List deps = Arrays.asList( - "{:tesla, \"~> 1.2\"}", - "{:poison, \"~> 3.0\"}" + "{:tesla, \"~> 1.4\"}", + "{:poison, \"~> 3.0\"}", + "{:ex_doc, \"~> 0.28\", only: :dev, runtime: false}" ); public ElixirClientCodegen() { @@ -150,10 +153,18 @@ public ElixirClientCodegen() { "config", "config.exs") ); + supportingFiles.add(new SupportingFile("runtime.exs.mustache", + "config", + "runtime.exs") + ); supportingFiles.add(new SupportingFile("mix.exs.mustache", "", "mix.exs") ); + supportingFiles.add(new SupportingFile("formatter.exs", + "", + ".formatter.exs") + ); supportingFiles.add(new SupportingFile("test_helper.exs.mustache", "test", "test_helper.exs") @@ -262,6 +273,19 @@ public void execute(Template.Fragment fragment, Writer writer) throws IOExceptio writer.write(modulized(fragment.execute())); } }); + additionalProperties.put("atom", new Mustache.Lambda() { + @Override + public void execute(Template.Fragment fragment, Writer writer) throws IOException { + writer.write(atomized(fragment.execute())); + } + }); + additionalProperties.put("env_var", new Mustache.Lambda() { + @Override + public void execute(Template.Fragment fragment, Writer writer) throws IOException { + String text = underscored(fragment.execute()); + writer.write(text.toUpperCase(Locale.ROOT)); + } + }); if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { setModuleName((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); @@ -377,6 +401,26 @@ private String modulized(String words) { return join("", modulizedWords); } + private String atomized(String text) { + StringBuilder atom = new StringBuilder(); + Matcher m = simpleAtomPattern.matcher(text); + + atom.append(":"); + + if (!m.matches()) { + atom.append("\""); + } + + atom.append(text); + + if (!m.matches()) { + atom.append("\""); + } + + return atom.toString(); + } + + /** * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping * those terms here. This logic is only called if a variable matches the reserved words diff --git a/modules/openapi-generator/src/main/resources/elixir/api.mustache b/modules/openapi-generator/src/main/resources/elixir/api.mustache index eb923cb39204..6d5e0d44fa7f 100644 --- a/modules/openapi-generator/src/main/resources/elixir/api.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/api.mustache @@ -48,7 +48,7 @@ defmodule {{moduleName}}.Api.{{classname}} do :body => :body {{/isBodyParam}} {{^isBodyParam}} - :"{{baseName}}" => {{#isFormParam}}:form{{/isFormParam}}{{#isQueryParam}}:query{{/isQueryParam}}{{#isHeaderParam}}:headers{{/isHeaderParam}}{{^-last}},{{/-last}} + {{#atom}}{{baseName}}{{/atom}} => {{#isFormParam}}:form{{/isFormParam}}{{#isQueryParam}}:query{{/isQueryParam}}{{#isHeaderParam}}:headers{{/isHeaderParam}}{{^-last}},{{/-last}} {{/isBodyParam}} {{#-last}} } @@ -59,7 +59,7 @@ defmodule {{moduleName}}.Api.{{classname}} do |> url("{{replacedPathName}}") {{#requiredParams}} {{^isPathParam}} - |> add_param({{#isBodyParam}}:body{{/isBodyParam}}{{#isFormParam}}{{#isMultipart}}{{#isFile}}:file{{/isFile}}{{^isFile}}:form{{/isFile}}{{/isMultipart}}{{^isMultipart}}:form{{/isMultipart}}{{/isFormParam}}{{#isQueryParam}}:query{{/isQueryParam}}{{#isHeaderParam}}:headers{{/isHeaderParam}}, {{#isBodyParam}}:body, {{/isBodyParam}}{{^isBodyParam}}:"{{baseName}}", {{/isBodyParam}}{{#underscored}}{{paramName}}{{/underscored}}) + |> add_param({{#isBodyParam}}:body{{/isBodyParam}}{{#isFormParam}}{{#isMultipart}}{{#isFile}}:file{{/isFile}}{{^isFile}}:form{{/isFile}}{{/isMultipart}}{{^isMultipart}}:form{{/isMultipart}}{{/isFormParam}}{{#isQueryParam}}:query{{/isQueryParam}}{{#isHeaderParam}}:headers{{/isHeaderParam}}, {{#isBodyParam}}:body, {{/isBodyParam}}{{^isBodyParam}}{{#atom}}{{baseName}}{{/atom}}, {{/isBodyParam}}{{#underscored}}{{paramName}}{{/underscored}}) {{/isPathParam}} {{/requiredParams}} {{#optionalParams}} diff --git a/modules/openapi-generator/src/main/resources/elixir/config.exs.mustache b/modules/openapi-generator/src/main/resources/elixir/config.exs.mustache index da8f554eb7b7..05fd56545dc2 100644 --- a/modules/openapi-generator/src/main/resources/elixir/config.exs.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/config.exs.mustache @@ -1,32 +1,15 @@ # This file is responsible for configuring your application -# and its dependencies with the aid of the Mix.Config module. -use Mix.Config - -# This configuration is loaded before any dependency and is restricted -# to this project. If another project depends on this project, this -# file won't be loaded nor affect the parent project. For this reason, -# if you want to provide default values for your application for -# 3rd-party users, it should be done in your "mix.exs" file. - -# You can configure for your application as: -# -# config :{{#underscored}}{{appName}}{{/underscored}}, key: :value -# -# And access this configuration in your application as: -# -# Application.get_env(:{{#underscored}}{{appName}}{{/underscored}}, :key) -# -# Or configure a 3rd-party app: -# -# config :logger, level: :info +# and its dependencies with the aid of the Config module. # +# This configuration file is loaded before any dependency and +# is restricted to this project. + +# General application configuration +import Config config :{{#underscored}}{{appName}}{{/underscored}}, base_url: "{{{basePath}}}" -# It is also possible to import configuration files, relative to this -# directory. For example, you can emulate configuration per environment -# by uncommenting the line below and defining dev.exs, test.exs and such. -# Configuration from the imported file will override the ones defined -# here (which is why it is important to import them last). +# Import environment specific config. This must remain at the bottom +# of this file so it overrides the configuration defined above. # -# import_config "#{Mix.env}.exs" +# import_config "#{config_env()}.exs" diff --git a/modules/openapi-generator/src/main/resources/elixir/formatter.exs b/modules/openapi-generator/src/main/resources/elixir/formatter.exs new file mode 100644 index 000000000000..d304ff320a52 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/elixir/formatter.exs @@ -0,0 +1,3 @@ +[ + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] +] diff --git a/modules/openapi-generator/src/main/resources/elixir/mix.exs.mustache b/modules/openapi-generator/src/main/resources/elixir/mix.exs.mustache index fe7e9bcae39f..aa0547390873 100644 --- a/modules/openapi-generator/src/main/resources/elixir/mix.exs.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/mix.exs.mustache @@ -40,7 +40,7 @@ defmodule {{moduleName}}.Mixfile do defp package() do [ name: "{{#underscored}}{{packageName}}{{/underscored}}", - files: ~w(lib mix.exs README* LICENSE*), + files: ~w(.formatter.exs config lib mix.exs README* LICENSE*), licenses: ["{{licenseId}}"] ] end diff --git a/modules/openapi-generator/src/main/resources/elixir/model.mustache b/modules/openapi-generator/src/main/resources/elixir/model.mustache index 8f9c6fe0d17b..0f9cc57a8938 100644 --- a/modules/openapi-generator/src/main/resources/elixir/model.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/model.mustache @@ -6,12 +6,12 @@ @derive [Poison.Encoder] defstruct [ - {{#vars}}:"{{&baseName}}"{{^-last}}, + {{#vars}}{{#atom}}{{&baseName}}{{/atom}}{{^-last}}, {{/-last}}{{/vars}} ] @type t :: %__MODULE__{ - {{#vars}}:"{{&baseName}}" => {{{datatype}}}{{#isNullable}} | nil{{/isNullable}}{{^isNullable}}{{^required}} | nil{{/required}}{{/isNullable}}{{^-last}}, + {{#vars}}{{#atom}}{{&baseName}}{{/atom}} => {{{datatype}}}{{#isNullable}} | nil{{/isNullable}}{{^isNullable}}{{^required}} | nil{{/required}}{{/isNullable}}{{^-last}}, {{/-last}}{{/vars}} } end @@ -23,7 +23,7 @@ defimpl Poison.Decoder, for: {{&moduleName}}.Model.{{&classname}} do value {{#vars}} {{^isPrimitiveType}} - {{#baseType}}|> deserialize(:"{{&baseName}}", {{#isArray}}:list, {{&moduleName}}.Model.{{{items.baseType}}}{{/isArray}}{{#isMap}}:map, {{&moduleName}}.Model.{{{items.baseType}}}{{/isMap}}{{#isDate}}:date, nil{{/isDate}}{{#isDateTime}}:date, nil{{/isDateTime}}{{^isDate}}{{^isDateTime}}{{^isMap}}{{^isArray}}:struct, {{moduleName}}.Model.{{baseType}}{{/isArray}}{{/isMap}}{{/isDateTime}}{{/isDate}}, options) + {{#baseType}}|> deserialize({{#atom}}{{&baseName}}{{/atom}}, {{#isArray}}:list, {{&moduleName}}.Model.{{{items.baseType}}}{{/isArray}}{{#isMap}}:map, {{&moduleName}}.Model.{{{items.baseType}}}{{/isMap}}{{#isDate}}:date, nil{{/isDate}}{{#isDateTime}}:date, nil{{/isDateTime}}{{^isDate}}{{^isDateTime}}{{^isMap}}{{^isArray}}:struct, {{moduleName}}.Model.{{baseType}}{{/isArray}}{{/isMap}}{{/isDateTime}}{{/isDate}}, options) {{/baseType}} {{/isPrimitiveType}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/elixir/runtime.exs.mustache b/modules/openapi-generator/src/main/resources/elixir/runtime.exs.mustache new file mode 100644 index 000000000000..e10c690c80ff --- /dev/null +++ b/modules/openapi-generator/src/main/resources/elixir/runtime.exs.mustache @@ -0,0 +1,12 @@ +import Config + +# config/runtime.exs is executed for all environments, including +# during releases. It is executed after compilation and before the +# system starts, so it is typically used to load production configuration +# and secrets from environment variables or elsewhere. Do not define +# any compile-time configuration in here, as it won't be applied. +# The block below contains prod specific runtime configuration. + +if env = System.get_env("{{#env_var}}{{appName}}{{/env_var}}_BASE_URI") do + config :{{#underscored}}{{appName}}{{/underscored}}, base_url: env +end diff --git a/samples/client/petstore/elixir/.formatter.exs b/samples/client/petstore/elixir/.formatter.exs new file mode 100644 index 000000000000..d304ff320a52 --- /dev/null +++ b/samples/client/petstore/elixir/.formatter.exs @@ -0,0 +1,3 @@ +[ + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] +] diff --git a/samples/client/petstore/elixir/.openapi-generator/FILES b/samples/client/petstore/elixir/.openapi-generator/FILES index 9f21ec0f85fa..c08711e03743 100644 --- a/samples/client/petstore/elixir/.openapi-generator/FILES +++ b/samples/client/petstore/elixir/.openapi-generator/FILES @@ -1,6 +1,9 @@ +.formatter.exs .gitignore +.openapi-generator-ignore README.md config/config.exs +config/runtime.exs lib/openapi_petstore/api/another_fake.ex lib/openapi_petstore/api/default.ex lib/openapi_petstore/api/fake.ex diff --git a/samples/client/petstore/elixir/config/config.exs b/samples/client/petstore/elixir/config/config.exs index e2fdf3c3b457..6056f2411d03 100644 --- a/samples/client/petstore/elixir/config/config.exs +++ b/samples/client/petstore/elixir/config/config.exs @@ -1,32 +1,15 @@ # This file is responsible for configuring your application -# and its dependencies with the aid of the Mix.Config module. -use Mix.Config - -# This configuration is loaded before any dependency and is restricted -# to this project. If another project depends on this project, this -# file won't be loaded nor affect the parent project. For this reason, -# if you want to provide default values for your application for -# 3rd-party users, it should be done in your "mix.exs" file. - -# You can configure for your application as: -# -# config :open_api_petstore, key: :value -# -# And access this configuration in your application as: -# -# Application.get_env(:open_api_petstore, :key) -# -# Or configure a 3rd-party app: -# -# config :logger, level: :info +# and its dependencies with the aid of the Config module. # +# This configuration file is loaded before any dependency and +# is restricted to this project. + +# General application configuration +import Config config :open_api_petstore, base_url: "http://petstore.swagger.io:80/v2" -# It is also possible to import configuration files, relative to this -# directory. For example, you can emulate configuration per environment -# by uncommenting the line below and defining dev.exs, test.exs and such. -# Configuration from the imported file will override the ones defined -# here (which is why it is important to import them last). +# Import environment specific config. This must remain at the bottom +# of this file so it overrides the configuration defined above. # -# import_config "#{Mix.env}.exs" +# import_config "#{config_env()}.exs" diff --git a/samples/client/petstore/elixir/config/runtime.exs b/samples/client/petstore/elixir/config/runtime.exs new file mode 100644 index 000000000000..a034b2dac436 --- /dev/null +++ b/samples/client/petstore/elixir/config/runtime.exs @@ -0,0 +1,12 @@ +import Config + +# config/runtime.exs is executed for all environments, including +# during releases. It is executed after compilation and before the +# system starts, so it is typically used to load production configuration +# and secrets from environment variables or elsewhere. Do not define +# any compile-time configuration in here, as it won't be applied. +# The block below contains prod specific runtime configuration. + +if env = System.get_env("OPEN_API_PETSTORE_BASE_URI") do + config :open_api_petstore, base_url: env +end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex index 1bf34def2343..1d2b32abc972 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -53,8 +53,8 @@ defmodule OpenapiPetstore.Api.Fake do @spec fake_http_signature_test(Tesla.Env.client, OpenapiPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def fake_http_signature_test(connection, pet, opts \\ []) do optional_params = %{ - :"query_1" => :query, - :"header_1" => :headers + :query_1 => :query, + :header_1 => :headers } %{} |> method(:get) @@ -284,7 +284,7 @@ defmodule OpenapiPetstore.Api.Fake do %{} |> method(:put) |> url("/fake/body-with-query-params") - |> add_param(:query, :"query", query) + |> add_param(:query, :query, query) |> add_param(:body, :body, user) |> Enum.into([]) |> (&Connection.request(connection, &1)).() @@ -350,24 +350,24 @@ defmodule OpenapiPetstore.Api.Fake do @spec test_endpoint_parameters(Tesla.Env.client, float(), float(), String.t, binary(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def test_endpoint_parameters(connection, number, double, pattern_without_delimiter, byte, opts \\ []) do optional_params = %{ - :"integer" => :form, - :"int32" => :form, - :"int64" => :form, - :"float" => :form, - :"string" => :form, - :"binary" => :form, - :"date" => :form, - :"dateTime" => :form, - :"password" => :form, - :"callback" => :form + :integer => :form, + :int32 => :form, + :int64 => :form, + :float => :form, + :string => :form, + :binary => :form, + :date => :form, + :dateTime => :form, + :password => :form, + :callback => :form } %{} |> method(:post) |> url("/fake") - |> add_param(:form, :"number", number) - |> add_param(:form, :"double", double) - |> add_param(:form, :"pattern_without_delimiter", pattern_without_delimiter) - |> add_param(:form, :"byte", byte) + |> add_param(:form, :number, number) + |> add_param(:form, :double, double) + |> add_param(:form, :pattern_without_delimiter, pattern_without_delimiter) + |> add_param(:form, :byte, byte) |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() @@ -402,15 +402,15 @@ defmodule OpenapiPetstore.Api.Fake do @spec test_enum_parameters(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def test_enum_parameters(connection, opts \\ []) do optional_params = %{ - :"enum_header_string_array" => :headers, - :"enum_header_string" => :headers, - :"enum_query_string_array" => :query, - :"enum_query_string" => :query, - :"enum_query_integer" => :query, - :"enum_query_double" => :query, - :"enum_query_model_array" => :query, - :"enum_form_string_array" => :form, - :"enum_form_string" => :form + :enum_header_string_array => :headers, + :enum_header_string => :headers, + :enum_query_string_array => :query, + :enum_query_string => :query, + :enum_query_integer => :query, + :enum_query_double => :query, + :enum_query_model_array => :query, + :enum_form_string_array => :form, + :enum_form_string => :form } %{} |> method(:get) @@ -446,16 +446,16 @@ defmodule OpenapiPetstore.Api.Fake do @spec test_group_parameters(Tesla.Env.client, integer(), boolean(), integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def test_group_parameters(connection, required_string_group, required_boolean_group, required_int64_group, opts \\ []) do optional_params = %{ - :"string_group" => :query, - :"boolean_group" => :headers, - :"int64_group" => :query + :string_group => :query, + :boolean_group => :headers, + :int64_group => :query } %{} |> method(:delete) |> url("/fake") - |> add_param(:query, :"required_string_group", required_string_group) - |> add_param(:headers, :"required_boolean_group", required_boolean_group) - |> add_param(:query, :"required_int64_group", required_int64_group) + |> add_param(:query, :required_string_group, required_string_group) + |> add_param(:headers, :required_boolean_group, required_boolean_group) + |> add_param(:query, :required_int64_group, required_int64_group) |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() @@ -511,8 +511,8 @@ defmodule OpenapiPetstore.Api.Fake do %{} |> method(:get) |> url("/fake/jsonFormData") - |> add_param(:form, :"param", param) - |> add_param(:form, :"param2", param2) + |> add_param(:form, :param, param) + |> add_param(:form, :param2, param2) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ @@ -542,17 +542,17 @@ defmodule OpenapiPetstore.Api.Fake do @spec test_query_parameter_collection_format(Tesla.Env.client, list(String.t), list(String.t), list(String.t), list(String.t), list(String.t), String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def test_query_parameter_collection_format(connection, pipe, ioutil, http, url, context, allow_empty, opts \\ []) do optional_params = %{ - :"language" => :query + :language => :query } %{} |> method(:put) |> url("/fake/test-query-parameters") - |> add_param(:query, :"pipe", pipe) - |> add_param(:query, :"ioutil", ioutil) - |> add_param(:query, :"http", http) - |> add_param(:query, :"url", url) - |> add_param(:query, :"context", context) - |> add_param(:query, :"allowEmpty", allow_empty) + |> add_param(:query, :pipe, pipe) + |> add_param(:query, :ioutil, ioutil) + |> add_param(:query, :http, http) + |> add_param(:query, :url, url) + |> add_param(:query, :context, context) + |> add_param(:query, :allowEmpty, allow_empty) |> add_optional_params(optional_params, opts) |> ensure_body() |> Enum.into([]) diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex index 37c96f322f6f..acc415d75ae1 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex @@ -57,7 +57,7 @@ defmodule OpenapiPetstore.Api.Pet do @spec delete_pet(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def delete_pet(connection, pet_id, opts \\ []) do optional_params = %{ - :"api_key" => :headers + :api_key => :headers } %{} |> method(:delete) @@ -90,7 +90,7 @@ defmodule OpenapiPetstore.Api.Pet do %{} |> method(:get) |> url("/pet/findByStatus") - |> add_param(:query, :"status", status) + |> add_param(:query, :status, status) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ @@ -118,7 +118,7 @@ defmodule OpenapiPetstore.Api.Pet do %{} |> method(:get) |> url("/pet/findByTags") - |> add_param(:query, :"tags", tags) + |> add_param(:query, :tags, tags) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ @@ -204,8 +204,8 @@ defmodule OpenapiPetstore.Api.Pet do @spec update_pet_with_form(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def update_pet_with_form(connection, pet_id, opts \\ []) do optional_params = %{ - :"name" => :form, - :"status" => :form + :name => :form, + :status => :form } %{} |> method(:post) @@ -239,8 +239,8 @@ defmodule OpenapiPetstore.Api.Pet do @spec upload_file(Tesla.Env.client, integer(), keyword()) :: {:ok, OpenapiPetstore.Model.ApiResponse.t} | {:error, Tesla.Env.t} def upload_file(connection, pet_id, opts \\ []) do optional_params = %{ - :"additionalMetadata" => :form, - :"file" => :form + :additionalMetadata => :form, + :file => :form } %{} |> method(:post) @@ -273,12 +273,12 @@ defmodule OpenapiPetstore.Api.Pet do @spec upload_file_with_required_file(Tesla.Env.client, integer(), String.t, keyword()) :: {:ok, OpenapiPetstore.Model.ApiResponse.t} | {:error, Tesla.Env.t} def upload_file_with_required_file(connection, pet_id, required_file, opts \\ []) do optional_params = %{ - :"additionalMetadata" => :form + :additionalMetadata => :form } %{} |> method(:post) |> url("/fake/#{pet_id}/uploadImageWithRequiredFile") - |> add_param(:file, :"requiredFile", required_file) + |> add_param(:file, :requiredFile, required_file) |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex index 2fd22f27e646..ea436c9e4051 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex @@ -167,8 +167,8 @@ defmodule OpenapiPetstore.Api.User do %{} |> method(:get) |> url("/user/login") - |> add_param(:query, :"username", username) - |> add_param(:query, :"password", password) + |> add_param(:query, :username, username) + |> add_param(:query, :password, password) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/_foo_get_default_response.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/_foo_get_default_response.ex index 5ad08d621fee..c48a99b52eed 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/_foo_get_default_response.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/_foo_get_default_response.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.FooGetDefaultResponse do @derive [Poison.Encoder] defstruct [ - :"string" + :string ] @type t :: %__MODULE__{ - :"string" => OpenapiPetstore.Model.Foo.t | nil + :string => OpenapiPetstore.Model.Foo.t | nil } end @@ -21,7 +21,7 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.FooGetDefaultResponse do import OpenapiPetstore.Deserializer def decode(value, options) do value - |> deserialize(:"string", :struct, OpenapiPetstore.Model.Foo, options) + |> deserialize(:string, :struct, OpenapiPetstore.Model.Foo, options) end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_any_type.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_any_type.ex deleted file mode 100644 index 36cc16ce42e2..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_any_type.ex +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.AdditionalPropertiesAnyType do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"name" - ] - - @type t :: %__MODULE__{ - :"name" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesAnyType do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_array.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_array.ex deleted file mode 100644 index 5279e66ad78f..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_array.ex +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.AdditionalPropertiesArray do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"name" - ] - - @type t :: %__MODULE__{ - :"name" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesArray do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_boolean.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_boolean.ex deleted file mode 100644 index 3a338e6b05c6..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_boolean.ex +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.AdditionalPropertiesBoolean do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"name" - ] - - @type t :: %__MODULE__{ - :"name" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesBoolean do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex index 837bf62a7ce1..722af9396b11 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex @@ -9,13 +9,13 @@ defmodule OpenapiPetstore.Model.AdditionalPropertiesClass do @derive [Poison.Encoder] defstruct [ - :"map_property", - :"map_of_map_property" + :map_property, + :map_of_map_property ] @type t :: %__MODULE__{ - :"map_property" => %{optional(String.t) => String.t} | nil, - :"map_of_map_property" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil + :map_property => %{optional(String.t) => String.t} | nil, + :map_of_map_property => %{optional(String.t) => %{optional(String.t) => String.t}} | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_integer.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_integer.ex deleted file mode 100644 index 06144a65df44..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_integer.ex +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.AdditionalPropertiesInteger do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"name" - ] - - @type t :: %__MODULE__{ - :"name" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesInteger do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_number.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_number.ex deleted file mode 100644 index 646b8bef38bd..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_number.ex +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.AdditionalPropertiesNumber do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"name" - ] - - @type t :: %__MODULE__{ - :"name" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesNumber do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_object.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_object.ex deleted file mode 100644 index be9b2d866c3d..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_object.ex +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.AdditionalPropertiesObject do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"name" - ] - - @type t :: %__MODULE__{ - :"name" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesObject do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_string.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_string.ex deleted file mode 100644 index 9a53ba07ab36..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_string.ex +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.AdditionalPropertiesString do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"name" - ] - - @type t :: %__MODULE__{ - :"name" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesString do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/all_of_with_single_ref.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/all_of_with_single_ref.ex index f76ffcb62918..eaef9cbfcf82 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/all_of_with_single_ref.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/all_of_with_single_ref.ex @@ -9,13 +9,13 @@ defmodule OpenapiPetstore.Model.AllOfWithSingleRef do @derive [Poison.Encoder] defstruct [ - :"username", - :"SingleRefType" + :username, + :SingleRefType ] @type t :: %__MODULE__{ - :"username" => String.t | nil, - :"SingleRefType" => SingleRefType | nil + :username => String.t | nil, + :SingleRefType => SingleRefType | nil } end @@ -23,7 +23,7 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.AllOfWithSingleRef do import OpenapiPetstore.Deserializer def decode(value, options) do value - |> deserialize(:"SingleRefType", :struct, OpenapiPetstore.Model.SingleRefType, options) + |> deserialize(:SingleRefType, :struct, OpenapiPetstore.Model.SingleRefType, options) end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex index deb93a04d0e0..2457f9dca175 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex @@ -9,13 +9,13 @@ defmodule OpenapiPetstore.Model.Animal do @derive [Poison.Encoder] defstruct [ - :"className", - :"color" + :className, + :color ] @type t :: %__MODULE__{ - :"className" => String.t, - :"color" => String.t | nil + :className => String.t, + :color => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex index 7dc34e32ad7d..5df3e445eb4e 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex @@ -9,15 +9,15 @@ defmodule OpenapiPetstore.Model.ApiResponse do @derive [Poison.Encoder] defstruct [ - :"code", - :"type", - :"message" + :code, + :type, + :message ] @type t :: %__MODULE__{ - :"code" => integer() | nil, - :"type" => String.t | nil, - :"message" => String.t | nil + :code => integer() | nil, + :type => String.t | nil, + :message => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex index e126f51109c3..d0312d28ca68 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.ArrayOfArrayOfNumberOnly do @derive [Poison.Encoder] defstruct [ - :"ArrayArrayNumber" + :ArrayArrayNumber ] @type t :: %__MODULE__{ - :"ArrayArrayNumber" => [[float()]] | nil + :ArrayArrayNumber => [[float()]] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex index 2e8e53552480..770c78e85a77 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.ArrayOfNumberOnly do @derive [Poison.Encoder] defstruct [ - :"ArrayNumber" + :ArrayNumber ] @type t :: %__MODULE__{ - :"ArrayNumber" => [float()] | nil + :ArrayNumber => [float()] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex index ccf61c3b5c7e..0314a883255a 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex @@ -9,15 +9,15 @@ defmodule OpenapiPetstore.Model.ArrayTest do @derive [Poison.Encoder] defstruct [ - :"array_of_string", - :"array_array_of_integer", - :"array_array_of_model" + :array_of_string, + :array_array_of_integer, + :array_array_of_model ] @type t :: %__MODULE__{ - :"array_of_string" => [String.t] | nil, - :"array_array_of_integer" => [[integer()]] | nil, - :"array_array_of_model" => [[OpenapiPetstore.Model.ReadOnlyFirst.t]] | nil + :array_of_string => [String.t] | nil, + :array_array_of_integer => [[integer()]] | nil, + :array_array_of_model => [[OpenapiPetstore.Model.ReadOnlyFirst.t]] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat.ex deleted file mode 100644 index 46d755bde725..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat.ex +++ /dev/null @@ -1,31 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.BigCat do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"className", - :"color", - :"declawed", - :"kind" - ] - - @type t :: %__MODULE__{ - :"className" => String.t, - :"color" => String.t | nil, - :"declawed" => boolean() | nil, - :"kind" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.BigCat do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat_all_of.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat_all_of.ex deleted file mode 100644 index 739bdd5ee4dc..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat_all_of.ex +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.BigCatAllOf do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"kind" - ] - - @type t :: %__MODULE__{ - :"kind" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.BigCatAllOf do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex index e9627cf3341f..23e25dfa3639 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex @@ -9,21 +9,21 @@ defmodule OpenapiPetstore.Model.Capitalization do @derive [Poison.Encoder] defstruct [ - :"smallCamel", - :"CapitalCamel", - :"small_Snake", - :"Capital_Snake", - :"SCA_ETH_Flow_Points", - :"ATT_NAME" + :smallCamel, + :CapitalCamel, + :small_Snake, + :Capital_Snake, + :SCA_ETH_Flow_Points, + :ATT_NAME ] @type t :: %__MODULE__{ - :"smallCamel" => String.t | nil, - :"CapitalCamel" => String.t | nil, - :"small_Snake" => String.t | nil, - :"Capital_Snake" => String.t | nil, - :"SCA_ETH_Flow_Points" => String.t | nil, - :"ATT_NAME" => String.t | nil + :smallCamel => String.t | nil, + :CapitalCamel => String.t | nil, + :small_Snake => String.t | nil, + :Capital_Snake => String.t | nil, + :SCA_ETH_Flow_Points => String.t | nil, + :ATT_NAME => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex index 416bb0a73ebe..d3281a7ac124 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex @@ -9,15 +9,15 @@ defmodule OpenapiPetstore.Model.Cat do @derive [Poison.Encoder] defstruct [ - :"className", - :"color", - :"declawed" + :className, + :color, + :declawed ] @type t :: %__MODULE__{ - :"className" => String.t, - :"color" => String.t | nil, - :"declawed" => boolean() | nil + :className => String.t, + :color => String.t | nil, + :declawed => boolean() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/cat_all_of.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/cat_all_of.ex index 5166b373834c..6935c289a088 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/cat_all_of.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/cat_all_of.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.CatAllOf do @derive [Poison.Encoder] defstruct [ - :"declawed" + :declawed ] @type t :: %__MODULE__{ - :"declawed" => boolean() | nil + :declawed => boolean() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex index 2d1c853ab499..678b66a0708a 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex @@ -9,13 +9,13 @@ defmodule OpenapiPetstore.Model.Category do @derive [Poison.Encoder] defstruct [ - :"id", - :"name" + :id, + :name ] @type t :: %__MODULE__{ - :"id" => integer() | nil, - :"name" => String.t + :id => integer() | nil, + :name => String.t } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex index 95fe85e3c9bd..ba4118604848 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.ClassModel do @derive [Poison.Encoder] defstruct [ - :"_class" + :_class ] @type t :: %__MODULE__{ - :"_class" => String.t | nil + :_class => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex index cd5a452028bb..6ef6dddec01c 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.Client do @derive [Poison.Encoder] defstruct [ - :"client" + :client ] @type t :: %__MODULE__{ - :"client" => String.t | nil + :client => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/deprecated_object.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/deprecated_object.ex index 098c55b88acc..0fd11a2a2256 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/deprecated_object.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/deprecated_object.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.DeprecatedObject do @derive [Poison.Encoder] defstruct [ - :"name" + :name ] @type t :: %__MODULE__{ - :"name" => String.t | nil + :name => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex index f4a7eae34ab6..567f056d8e87 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex @@ -9,15 +9,15 @@ defmodule OpenapiPetstore.Model.Dog do @derive [Poison.Encoder] defstruct [ - :"className", - :"color", - :"breed" + :className, + :color, + :breed ] @type t :: %__MODULE__{ - :"className" => String.t, - :"color" => String.t | nil, - :"breed" => String.t | nil + :className => String.t, + :color => String.t | nil, + :breed => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/dog_all_of.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/dog_all_of.ex index 31c0ff6e507c..5898abad3d00 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/dog_all_of.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/dog_all_of.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.DogAllOf do @derive [Poison.Encoder] defstruct [ - :"breed" + :breed ] @type t :: %__MODULE__{ - :"breed" => String.t | nil + :breed => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex index d8f98a028a78..28f27eb79d08 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex @@ -9,13 +9,13 @@ defmodule OpenapiPetstore.Model.EnumArrays do @derive [Poison.Encoder] defstruct [ - :"just_symbol", - :"array_enum" + :just_symbol, + :array_enum ] @type t :: %__MODULE__{ - :"just_symbol" => String.t | nil, - :"array_enum" => [String.t] | nil + :just_symbol => String.t | nil, + :array_enum => [String.t] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex index 0d33162d2561..1af76bedb331 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex @@ -9,25 +9,25 @@ defmodule OpenapiPetstore.Model.EnumTest do @derive [Poison.Encoder] defstruct [ - :"enum_string", - :"enum_string_required", - :"enum_integer", - :"enum_number", - :"outerEnum", - :"outerEnumInteger", - :"outerEnumDefaultValue", - :"outerEnumIntegerDefaultValue" + :enum_string, + :enum_string_required, + :enum_integer, + :enum_number, + :outerEnum, + :outerEnumInteger, + :outerEnumDefaultValue, + :outerEnumIntegerDefaultValue ] @type t :: %__MODULE__{ - :"enum_string" => String.t | nil, - :"enum_string_required" => String.t, - :"enum_integer" => integer() | nil, - :"enum_number" => float() | nil, - :"outerEnum" => OpenapiPetstore.Model.OuterEnum.t | nil, - :"outerEnumInteger" => OpenapiPetstore.Model.OuterEnumInteger.t | nil, - :"outerEnumDefaultValue" => OpenapiPetstore.Model.OuterEnumDefaultValue.t | nil, - :"outerEnumIntegerDefaultValue" => OpenapiPetstore.Model.OuterEnumIntegerDefaultValue.t | nil + :enum_string => String.t | nil, + :enum_string_required => String.t, + :enum_integer => integer() | nil, + :enum_number => float() | nil, + :outerEnum => OpenapiPetstore.Model.OuterEnum.t | nil, + :outerEnumInteger => OpenapiPetstore.Model.OuterEnumInteger.t | nil, + :outerEnumDefaultValue => OpenapiPetstore.Model.OuterEnumDefaultValue.t | nil, + :outerEnumIntegerDefaultValue => OpenapiPetstore.Model.OuterEnumIntegerDefaultValue.t | nil } end @@ -35,10 +35,10 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.EnumTest do import OpenapiPetstore.Deserializer def decode(value, options) do value - |> deserialize(:"outerEnum", :struct, OpenapiPetstore.Model.OuterEnum, options) - |> deserialize(:"outerEnumInteger", :struct, OpenapiPetstore.Model.OuterEnumInteger, options) - |> deserialize(:"outerEnumDefaultValue", :struct, OpenapiPetstore.Model.OuterEnumDefaultValue, options) - |> deserialize(:"outerEnumIntegerDefaultValue", :struct, OpenapiPetstore.Model.OuterEnumIntegerDefaultValue, options) + |> deserialize(:outerEnum, :struct, OpenapiPetstore.Model.OuterEnum, options) + |> deserialize(:outerEnumInteger, :struct, OpenapiPetstore.Model.OuterEnumInteger, options) + |> deserialize(:outerEnumDefaultValue, :struct, OpenapiPetstore.Model.OuterEnumDefaultValue, options) + |> deserialize(:outerEnumIntegerDefaultValue, :struct, OpenapiPetstore.Model.OuterEnumIntegerDefaultValue, options) end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/file.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/file.ex index 252466680dea..659a4b26ec88 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/file.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/file.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.File do @derive [Poison.Encoder] defstruct [ - :"sourceURI" + :sourceURI ] @type t :: %__MODULE__{ - :"sourceURI" => String.t | nil + :sourceURI => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex index 6c91069f9c9f..9edcf4f8a096 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex @@ -9,13 +9,13 @@ defmodule OpenapiPetstore.Model.FileSchemaTestClass do @derive [Poison.Encoder] defstruct [ - :"file", - :"files" + :file, + :files ] @type t :: %__MODULE__{ - :"file" => OpenapiPetstore.Model.File.t | nil, - :"files" => [OpenapiPetstore.Model.File.t] | nil + :file => OpenapiPetstore.Model.File.t | nil, + :files => [OpenapiPetstore.Model.File.t] | nil } end @@ -23,8 +23,8 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.FileSchemaTestClass do import OpenapiPetstore.Deserializer def decode(value, options) do value - |> deserialize(:"file", :struct, OpenapiPetstore.Model.File, options) - |> deserialize(:"files", :list, OpenapiPetstore.Model.File, options) + |> deserialize(:file, :struct, OpenapiPetstore.Model.File, options) + |> deserialize(:files, :list, OpenapiPetstore.Model.File, options) end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/foo.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/foo.ex index d73897b40ecb..b25263be9a5a 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/foo.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/foo.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.Foo do @derive [Poison.Encoder] defstruct [ - :"bar" + :bar ] @type t :: %__MODULE__{ - :"bar" => String.t | nil + :bar => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex index 5c7e4a64290a..6dafb14d706f 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex @@ -9,41 +9,41 @@ defmodule OpenapiPetstore.Model.FormatTest do @derive [Poison.Encoder] defstruct [ - :"integer", - :"int32", - :"int64", - :"number", - :"float", - :"double", - :"decimal", - :"string", - :"byte", - :"binary", - :"date", - :"dateTime", - :"uuid", - :"password", - :"pattern_with_digits", - :"pattern_with_digits_and_delimiter" + :integer, + :int32, + :int64, + :number, + :float, + :double, + :decimal, + :string, + :byte, + :binary, + :date, + :dateTime, + :uuid, + :password, + :pattern_with_digits, + :pattern_with_digits_and_delimiter ] @type t :: %__MODULE__{ - :"integer" => integer() | nil, - :"int32" => integer() | nil, - :"int64" => integer() | nil, - :"number" => float(), - :"float" => float() | nil, - :"double" => float() | nil, - :"decimal" => String.t | nil, - :"string" => String.t | nil, - :"byte" => binary(), - :"binary" => String.t | nil, - :"date" => Date.t, - :"dateTime" => DateTime.t | nil, - :"uuid" => String.t | nil, - :"password" => String.t, - :"pattern_with_digits" => String.t | nil, - :"pattern_with_digits_and_delimiter" => String.t | nil + :integer => integer() | nil, + :int32 => integer() | nil, + :int64 => integer() | nil, + :number => float(), + :float => float() | nil, + :double => float() | nil, + :decimal => String.t | nil, + :string => String.t | nil, + :byte => binary(), + :binary => String.t | nil, + :date => Date.t, + :dateTime => DateTime.t | nil, + :uuid => String.t | nil, + :password => String.t, + :pattern_with_digits => String.t | nil, + :pattern_with_digits_and_delimiter => String.t | nil } end @@ -51,7 +51,7 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.FormatTest do import OpenapiPetstore.Deserializer def decode(value, options) do value - |> deserialize(:"date", :date, nil, options) + |> deserialize(:date, :date, nil, options) end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex index 1a1fa302edbf..c8bf68f5b236 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex @@ -9,13 +9,13 @@ defmodule OpenapiPetstore.Model.HasOnlyReadOnly do @derive [Poison.Encoder] defstruct [ - :"bar", - :"foo" + :bar, + :foo ] @type t :: %__MODULE__{ - :"bar" => String.t | nil, - :"foo" => String.t | nil + :bar => String.t | nil, + :foo => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/health_check_result.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/health_check_result.ex index 269dc67b7dbd..339a5fe876f9 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/health_check_result.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/health_check_result.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.HealthCheckResult do @derive [Poison.Encoder] defstruct [ - :"NullableMessage" + :NullableMessage ] @type t :: %__MODULE__{ - :"NullableMessage" => String.t | nil + :NullableMessage => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/inline_response_default.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/inline_response_default.ex deleted file mode 100644 index 0bc779e95199..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/inline_response_default.ex +++ /dev/null @@ -1,27 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.InlineResponseDefault do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"string" - ] - - @type t :: %__MODULE__{ - :"string" => OpenapiPetstore.Model.Foo.t | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.InlineResponseDefault do - import OpenapiPetstore.Deserializer - def decode(value, options) do - value - |> deserialize(:"string", :struct, OpenapiPetstore.Model.Foo, options) - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex index 726814dd8177..6d94cf83c115 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex @@ -9,17 +9,17 @@ defmodule OpenapiPetstore.Model.MapTest do @derive [Poison.Encoder] defstruct [ - :"map_map_of_string", - :"map_of_enum_string", - :"direct_map", - :"indirect_map" + :map_map_of_string, + :map_of_enum_string, + :direct_map, + :indirect_map ] @type t :: %__MODULE__{ - :"map_map_of_string" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil, - :"map_of_enum_string" => %{optional(String.t) => String.t} | nil, - :"direct_map" => %{optional(String.t) => boolean()} | nil, - :"indirect_map" => %{optional(String.t) => boolean()} | nil + :map_map_of_string => %{optional(String.t) => %{optional(String.t) => String.t}} | nil, + :map_of_enum_string => %{optional(String.t) => String.t} | nil, + :direct_map => %{optional(String.t) => boolean()} | nil, + :indirect_map => %{optional(String.t) => boolean()} | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex index c807226af279..a8e4981cd372 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex @@ -9,15 +9,15 @@ defmodule OpenapiPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do @derive [Poison.Encoder] defstruct [ - :"uuid", - :"dateTime", - :"map" + :uuid, + :dateTime, + :map ] @type t :: %__MODULE__{ - :"uuid" => String.t | nil, - :"dateTime" => DateTime.t | nil, - :"map" => %{optional(String.t) => OpenapiPetstore.Model.Animal.t} | nil + :uuid => String.t | nil, + :dateTime => DateTime.t | nil, + :map => %{optional(String.t) => OpenapiPetstore.Model.Animal.t} | nil } end @@ -25,7 +25,7 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.MixedPropertiesAndAdditionalP import OpenapiPetstore.Deserializer def decode(value, options) do value - |> deserialize(:"map", :map, OpenapiPetstore.Model.Animal, options) + |> deserialize(:map, :map, OpenapiPetstore.Model.Animal, options) end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex index 2bc6d1529066..3fbd1067f71a 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex @@ -9,13 +9,13 @@ defmodule OpenapiPetstore.Model.Model200Response do @derive [Poison.Encoder] defstruct [ - :"name", - :"class" + :name, + :class ] @type t :: %__MODULE__{ - :"name" => integer() | nil, - :"class" => String.t | nil + :name => integer() | nil, + :class => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex index cd2fdce24d09..42d93796dd53 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex @@ -9,16 +9,16 @@ defmodule OpenapiPetstore.Model.Name do @derive [Poison.Encoder] defstruct [ - :"name", - :"snake_case", - :"property", + :name, + :snake_case, + :property, :"123Number" ] @type t :: %__MODULE__{ - :"name" => integer(), - :"snake_case" => integer() | nil, - :"property" => String.t | nil, + :name => integer(), + :snake_case => integer() | nil, + :property => String.t | nil, :"123Number" => integer() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/nullable_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/nullable_class.ex index 7fcdc03ddc54..45174fd475b6 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/nullable_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/nullable_class.ex @@ -9,33 +9,33 @@ defmodule OpenapiPetstore.Model.NullableClass do @derive [Poison.Encoder] defstruct [ - :"integer_prop", - :"number_prop", - :"boolean_prop", - :"string_prop", - :"date_prop", - :"datetime_prop", - :"array_nullable_prop", - :"array_and_items_nullable_prop", - :"array_items_nullable", - :"object_nullable_prop", - :"object_and_items_nullable_prop", - :"object_items_nullable" + :integer_prop, + :number_prop, + :boolean_prop, + :string_prop, + :date_prop, + :datetime_prop, + :array_nullable_prop, + :array_and_items_nullable_prop, + :array_items_nullable, + :object_nullable_prop, + :object_and_items_nullable_prop, + :object_items_nullable ] @type t :: %__MODULE__{ - :"integer_prop" => integer() | nil, - :"number_prop" => float() | nil, - :"boolean_prop" => boolean() | nil, - :"string_prop" => String.t | nil, - :"date_prop" => Date.t | nil, - :"datetime_prop" => DateTime.t | nil, - :"array_nullable_prop" => [map()] | nil, - :"array_and_items_nullable_prop" => [map()] | nil, - :"array_items_nullable" => [map()] | nil, - :"object_nullable_prop" => %{optional(String.t) => map()} | nil, - :"object_and_items_nullable_prop" => %{optional(String.t) => map()} | nil, - :"object_items_nullable" => %{optional(String.t) => map()} | nil + :integer_prop => integer() | nil, + :number_prop => float() | nil, + :boolean_prop => boolean() | nil, + :string_prop => String.t | nil, + :date_prop => Date.t | nil, + :datetime_prop => DateTime.t | nil, + :array_nullable_prop => [map()] | nil, + :array_and_items_nullable_prop => [map()] | nil, + :array_items_nullable => [map()] | nil, + :object_nullable_prop => %{optional(String.t) => map()} | nil, + :object_and_items_nullable_prop => %{optional(String.t) => map()} | nil, + :object_items_nullable => %{optional(String.t) => map()} | nil } end @@ -43,7 +43,7 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.NullableClass do import OpenapiPetstore.Deserializer def decode(value, options) do value - |> deserialize(:"date_prop", :date, nil, options) + |> deserialize(:date_prop, :date, nil, options) end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex index 825553cf9f3f..5658d133140c 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.NumberOnly do @derive [Poison.Encoder] defstruct [ - :"JustNumber" + :JustNumber ] @type t :: %__MODULE__{ - :"JustNumber" => float() | nil + :JustNumber => float() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/object_with_deprecated_fields.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/object_with_deprecated_fields.ex index 71c8cb4a822e..a3f5cc4a5382 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/object_with_deprecated_fields.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/object_with_deprecated_fields.ex @@ -9,17 +9,17 @@ defmodule OpenapiPetstore.Model.ObjectWithDeprecatedFields do @derive [Poison.Encoder] defstruct [ - :"uuid", - :"id", - :"deprecatedRef", - :"bars" + :uuid, + :id, + :deprecatedRef, + :bars ] @type t :: %__MODULE__{ - :"uuid" => String.t | nil, - :"id" => float() | nil, - :"deprecatedRef" => OpenapiPetstore.Model.DeprecatedObject.t | nil, - :"bars" => [OpenapiPetstore.Model.String.t] | nil + :uuid => String.t | nil, + :id => float() | nil, + :deprecatedRef => OpenapiPetstore.Model.DeprecatedObject.t | nil, + :bars => [OpenapiPetstore.Model.String.t] | nil } end @@ -27,7 +27,7 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.ObjectWithDeprecatedFields do import OpenapiPetstore.Deserializer def decode(value, options) do value - |> deserialize(:"deprecatedRef", :struct, OpenapiPetstore.Model.DeprecatedObject, options) + |> deserialize(:deprecatedRef, :struct, OpenapiPetstore.Model.DeprecatedObject, options) end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex index 936a7039dce3..0b430ca41c28 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex @@ -9,21 +9,21 @@ defmodule OpenapiPetstore.Model.Order do @derive [Poison.Encoder] defstruct [ - :"id", - :"petId", - :"quantity", - :"shipDate", - :"status", - :"complete" + :id, + :petId, + :quantity, + :shipDate, + :status, + :complete ] @type t :: %__MODULE__{ - :"id" => integer() | nil, - :"petId" => integer() | nil, - :"quantity" => integer() | nil, - :"shipDate" => DateTime.t | nil, - :"status" => String.t | nil, - :"complete" => boolean() | nil + :id => integer() | nil, + :petId => integer() | nil, + :quantity => integer() | nil, + :shipDate => DateTime.t | nil, + :status => String.t | nil, + :complete => boolean() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex index 04143a20a576..abacaa6d85dc 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex @@ -9,15 +9,15 @@ defmodule OpenapiPetstore.Model.OuterComposite do @derive [Poison.Encoder] defstruct [ - :"my_number", - :"my_string", - :"my_boolean" + :my_number, + :my_string, + :my_boolean ] @type t :: %__MODULE__{ - :"my_number" => float() | nil, - :"my_string" => String.t | nil, - :"my_boolean" => boolean() | nil + :my_number => float() | nil, + :my_string => String.t | nil, + :my_boolean => boolean() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_object_with_enum_property.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_object_with_enum_property.ex index 2eed9a6dfa4c..23502200bff6 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_object_with_enum_property.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_object_with_enum_property.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.OuterObjectWithEnumProperty do @derive [Poison.Encoder] defstruct [ - :"value" + :value ] @type t :: %__MODULE__{ - :"value" => OpenapiPetstore.Model.OuterEnumInteger.t + :value => OpenapiPetstore.Model.OuterEnumInteger.t } end @@ -21,7 +21,7 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.OuterObjectWithEnumProperty d import OpenapiPetstore.Deserializer def decode(value, options) do value - |> deserialize(:"value", :struct, OpenapiPetstore.Model.OuterEnumInteger, options) + |> deserialize(:value, :struct, OpenapiPetstore.Model.OuterEnumInteger, options) end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex index a46e041dcb73..046e5bee22ab 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex @@ -9,21 +9,21 @@ defmodule OpenapiPetstore.Model.Pet do @derive [Poison.Encoder] defstruct [ - :"id", - :"category", - :"name", - :"photoUrls", - :"tags", - :"status" + :id, + :category, + :name, + :photoUrls, + :tags, + :status ] @type t :: %__MODULE__{ - :"id" => integer() | nil, - :"category" => OpenapiPetstore.Model.Category.t | nil, - :"name" => String.t, - :"photoUrls" => [String.t], - :"tags" => [OpenapiPetstore.Model.Tag.t] | nil, - :"status" => String.t | nil + :id => integer() | nil, + :category => OpenapiPetstore.Model.Category.t | nil, + :name => String.t, + :photoUrls => [String.t], + :tags => [OpenapiPetstore.Model.Tag.t] | nil, + :status => String.t | nil } end @@ -31,8 +31,8 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.Pet do import OpenapiPetstore.Deserializer def decode(value, options) do value - |> deserialize(:"category", :struct, OpenapiPetstore.Model.Category, options) - |> deserialize(:"tags", :list, OpenapiPetstore.Model.Tag, options) + |> deserialize(:category, :struct, OpenapiPetstore.Model.Category, options) + |> deserialize(:tags, :list, OpenapiPetstore.Model.Tag, options) end end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex index bfd2dda20726..6f36aba467e9 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex @@ -9,13 +9,13 @@ defmodule OpenapiPetstore.Model.ReadOnlyFirst do @derive [Poison.Encoder] defstruct [ - :"bar", - :"baz" + :bar, + :baz ] @type t :: %__MODULE__{ - :"bar" => String.t | nil, - :"baz" => String.t | nil + :bar => String.t | nil, + :baz => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex index 8a2102c5989c..54b3cbf391a3 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex @@ -9,11 +9,11 @@ defmodule OpenapiPetstore.Model.Return do @derive [Poison.Encoder] defstruct [ - :"return" + :return ] @type t :: %__MODULE__{ - :"return" => integer() | nil + :return => integer() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex deleted file mode 100644 index 429129b42a0f..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.SpecialModelName do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"$special[property.name]" - ] - - @type t :: %__MODULE__{ - :"$special[property.name]" => integer() | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.SpecialModelName do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex index 5dd3bac75020..f64ba461a365 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex @@ -9,13 +9,13 @@ defmodule OpenapiPetstore.Model.Tag do @derive [Poison.Encoder] defstruct [ - :"id", - :"name" + :id, + :name ] @type t :: %__MODULE__{ - :"id" => integer() | nil, - :"name" => String.t | nil + :id => integer() | nil, + :name => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/type_holder_default.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/type_holder_default.ex deleted file mode 100644 index 7964b258c776..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/type_holder_default.ex +++ /dev/null @@ -1,33 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.TypeHolderDefault do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"string_item", - :"number_item", - :"integer_item", - :"bool_item", - :"array_item" - ] - - @type t :: %__MODULE__{ - :"string_item" => String.t, - :"number_item" => float(), - :"integer_item" => integer(), - :"bool_item" => boolean(), - :"array_item" => [integer()] - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.TypeHolderDefault do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/type_holder_example.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/type_holder_example.ex deleted file mode 100644 index 194a74c32cf7..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/type_holder_example.ex +++ /dev/null @@ -1,35 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.TypeHolderExample do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"string_item", - :"number_item", - :"float_item", - :"integer_item", - :"bool_item", - :"array_item" - ] - - @type t :: %__MODULE__{ - :"string_item" => String.t, - :"number_item" => float(), - :"float_item" => float(), - :"integer_item" => integer(), - :"bool_item" => boolean(), - :"array_item" => [integer()] - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.TypeHolderExample do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex index faaf4ab9a963..368e3f52a348 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex @@ -9,25 +9,25 @@ defmodule OpenapiPetstore.Model.User do @derive [Poison.Encoder] defstruct [ - :"id", - :"username", - :"firstName", - :"lastName", - :"email", - :"password", - :"phone", - :"userStatus" + :id, + :username, + :firstName, + :lastName, + :email, + :password, + :phone, + :userStatus ] @type t :: %__MODULE__{ - :"id" => integer() | nil, - :"username" => String.t | nil, - :"firstName" => String.t | nil, - :"lastName" => String.t | nil, - :"email" => String.t | nil, - :"password" => String.t | nil, - :"phone" => String.t | nil, - :"userStatus" => integer() | nil + :id => integer() | nil, + :username => String.t | nil, + :firstName => String.t | nil, + :lastName => String.t | nil, + :email => String.t | nil, + :password => String.t | nil, + :phone => String.t | nil, + :userStatus => integer() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/xml_item.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/xml_item.ex deleted file mode 100644 index 48cb6a573eee..000000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/xml_item.ex +++ /dev/null @@ -1,81 +0,0 @@ -# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -# https://openapi-generator.tech -# Do not edit the class manually. - -defmodule OpenapiPetstore.Model.XmlItem do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"attribute_string", - :"attribute_number", - :"attribute_integer", - :"attribute_boolean", - :"wrapped_array", - :"name_string", - :"name_number", - :"name_integer", - :"name_boolean", - :"name_array", - :"name_wrapped_array", - :"prefix_string", - :"prefix_number", - :"prefix_integer", - :"prefix_boolean", - :"prefix_array", - :"prefix_wrapped_array", - :"namespace_string", - :"namespace_number", - :"namespace_integer", - :"namespace_boolean", - :"namespace_array", - :"namespace_wrapped_array", - :"prefix_ns_string", - :"prefix_ns_number", - :"prefix_ns_integer", - :"prefix_ns_boolean", - :"prefix_ns_array", - :"prefix_ns_wrapped_array" - ] - - @type t :: %__MODULE__{ - :"attribute_string" => String.t | nil, - :"attribute_number" => float() | nil, - :"attribute_integer" => integer() | nil, - :"attribute_boolean" => boolean() | nil, - :"wrapped_array" => [integer()] | nil, - :"name_string" => String.t | nil, - :"name_number" => float() | nil, - :"name_integer" => integer() | nil, - :"name_boolean" => boolean() | nil, - :"name_array" => [integer()] | nil, - :"name_wrapped_array" => [integer()] | nil, - :"prefix_string" => String.t | nil, - :"prefix_number" => float() | nil, - :"prefix_integer" => integer() | nil, - :"prefix_boolean" => boolean() | nil, - :"prefix_array" => [integer()] | nil, - :"prefix_wrapped_array" => [integer()] | nil, - :"namespace_string" => String.t | nil, - :"namespace_number" => float() | nil, - :"namespace_integer" => integer() | nil, - :"namespace_boolean" => boolean() | nil, - :"namespace_array" => [integer()] | nil, - :"namespace_wrapped_array" => [integer()] | nil, - :"prefix_ns_string" => String.t | nil, - :"prefix_ns_number" => float() | nil, - :"prefix_ns_integer" => integer() | nil, - :"prefix_ns_boolean" => boolean() | nil, - :"prefix_ns_array" => [integer()] | nil, - :"prefix_ns_wrapped_array" => [integer()] | nil - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.XmlItem do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/mix.exs b/samples/client/petstore/elixir/mix.exs index 2a761443616a..c03b200a50db 100644 --- a/samples/client/petstore/elixir/mix.exs +++ b/samples/client/petstore/elixir/mix.exs @@ -4,7 +4,7 @@ defmodule OpenapiPetstore.Mixfile do def project do [app: :openapi_petstore, version: "1.0.0", - elixir: "~> 1.6", + elixir: "~> 1.10", build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, package: package(), @@ -31,15 +31,16 @@ defmodule OpenapiPetstore.Mixfile do # Type "mix help deps" for more examples and options defp deps do [ - {:tesla, "~> 1.2"}, - {:poison, "~> 3.0"} + {:tesla, "~> 1.4"}, + {:poison, "~> 3.0"}, + {:ex_doc, "~> 0.28", only: :dev, runtime: false} ] end defp package() do [ name: "openapi_petstore", - files: ~w(lib mix.exs README* LICENSE*), + files: ~w(.formatter.exs config lib mix.exs README* LICENSE*), licenses: [""] ] end diff --git a/samples/client/petstore/elixir/pom.xml b/samples/client/petstore/elixir/pom.xml deleted file mode 100644 index 589db62d2dca..000000000000 --- a/samples/client/petstore/elixir/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - 4.0.0 - io.swagger - ElixirPetstoreClientTests - pom - 1.0-SNAPSHOT - Elixir Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - dep-install - pre-integration-test - - exec - - - mix - - local.hex - --force - - - - - compile - integration-test - - exec - - - mix - - do - deps.get, - compile - - - - - test - integration-test - - exec - - - mix - - test - - - - - - - - diff --git a/samples/client/petstore/elixir/test/pet_test.exs b/samples/client/petstore/elixir/test/pet_test.exs deleted file mode 100644 index 6011a08ccf58..000000000000 --- a/samples/client/petstore/elixir/test/pet_test.exs +++ /dev/null @@ -1,60 +0,0 @@ -defmodule PetTest do - use ExUnit.Case - alias OpenapiPetstore.Connection - alias OpenapiPetstore.Api.Pet, as: PetApi - alias OpenapiPetstore.Model.Pet - alias OpenapiPetstore.Model.Category - alias OpenapiPetstore.Model.Tag - - test "add and delete a pet" do - petId = 10007 - pet = %Pet{ - :id => petId, - :name => "elixir client test", - :photoUrls => ["http://test_elixir_unit_test.com"], - :category => %Category{:id => petId, :name=> "test elixir category"}, - :tags => [%Tag{:id => petId, :name => "test elixir tag"}], - } - {:ok, response} = PetApi.add_pet(Connection.new, pet) - assert response.status == 200 - - {:ok, pet} = PetApi.get_pet_by_id(Connection.new, petId) - assert pet.id == petId - assert pet.name == "elixir client test" - assert List.first(pet.photoUrls) == "http://test_elixir_unit_test.com" - assert pet.category.id == petId - assert pet.category.name == "test elixir category" - assert List.first(pet.tags) == %Tag{:id => petId, :name => "test elixir tag"} - - {:ok, response} = PetApi.delete_pet(Connection.new, petId) - assert response.status == 200 - {:ok, response} = PetApi.get_pet_by_id(Connection.new, petId) - assert response.status == 404 - end - - test "update a pet" do - petId = 10007 - pet = %Pet{ - :id => petId, - :name => "elixir client updatePet", - :status => "pending", - :photoUrls => ["http://test_elixir_unit_test.com"] - } - {:ok, response} = PetApi.update_pet(Connection.new, pet) - assert response.status == 200 - - {:ok, pet} = PetApi.get_pet_by_id(Connection.new, petId) - assert pet.id == petId - assert pet.name == "elixir client updatePet" - assert pet.status == "pending" - end - - test "find pet by status" do - {:ok, listPets} = PetApi.find_pets_by_status(Connection.new, "available") - assert List.first(listPets) != nil - - {:ok, listPets} = PetApi.find_pets_by_status(Connection.new, "unknown_and_incorrect_status") - assert List.first(listPets) == nil - end - -end