From 0ae43fcb7afb74c99287ee3aec7e30e453a000e1 Mon Sep 17 00:00:00 2001 From: Vincent Devos <46601673+karismann@users.noreply.github.com> Date: Fri, 26 Apr 2019 16:38:11 +0200 Subject: [PATCH] [Elixir] update to 1.6 version (#2741) * [Elixir] update version / add test * update samples (add missing 200 responses in petstore-with-fake-endpoints-models-for-testing.yaml) * [Elixir] update to 1.6 version * [Elixir] fix test petapi --- bin/elixir-petstore.sh | 4 +- bin/utils/ensure-up-to-date | 1 + .../languages/ElixirClientCodegen.java | 26 +- .../main/resources/elixir/README.md.mustache | 8 + .../resources/elixir/connection.ex.mustache | 6 +- .../main/resources/elixir/mix.exs.mustache | 4 +- ...ith-fake-endpoints-models-for-testing.yaml | 6 + samples/client/petstore/elixir/README.md | 16 +- .../lib/open_api_petstore/api/another_fake.ex | 40 -- .../lib/open_api_petstore/api/default.ex | 36 -- .../elixir/lib/open_api_petstore/api/fake.ex | 429 ------------------ .../api/fake_classname_tags123.ex | 40 -- .../elixir/lib/open_api_petstore/api/pet.ex | 277 ----------- .../elixir/lib/open_api_petstore/api/store.ex | 120 ----- .../elixir/lib/open_api_petstore/api/user.ex | 228 ---------- .../lib/open_api_petstore/connection.ex | 104 ----- .../lib/open_api_petstore/deserializer.ex | 38 -- .../model/_special_model_name_.ex | 25 - .../model/additional_properties_class.ex | 27 -- .../lib/open_api_petstore/model/animal.ex | 27 -- .../open_api_petstore/model/api_response.ex | 29 -- .../model/array_of_array_of_number_only.ex | 25 - .../lib/open_api_petstore/model/array_test.ex | 29 -- .../open_api_petstore/model/capitalization.ex | 35 -- .../elixir/lib/open_api_petstore/model/cat.ex | 29 -- .../open_api_petstore/model/class_model.ex | 25 - .../lib/open_api_petstore/model/client.ex | 25 - .../elixir/lib/open_api_petstore/model/dog.ex | 29 -- .../open_api_petstore/model/enum_arrays.ex | 27 -- .../lib/open_api_petstore/model/enum_test.ex | 44 -- .../model/file_schema_test_class.ex | 30 -- .../elixir/lib/open_api_petstore/model/foo.ex | 25 - .../open_api_petstore/model/format_test.ex | 55 --- .../model/has_only_read_only.ex | 27 -- .../model/health_check_result.ex | 25 - .../open_api_petstore/model/inline_object.ex | 27 -- .../model/inline_object_1.ex | 27 -- .../model/inline_object_2.ex | 27 -- .../model/inline_object_3.ex | 53 --- .../model/inline_object_4.ex | 27 -- .../model/inline_object_5.ex | 27 -- .../model/inline_response_default.ex | 27 -- .../lib/open_api_petstore/model/map_test.ex | 31 -- ...perties_and_additional_properties_class.ex | 31 -- .../model/model_200_response.ex | 27 -- .../lib/open_api_petstore/model/name.ex | 31 -- .../open_api_petstore/model/number_only.ex | 25 - .../lib/open_api_petstore/model/order.ex | 35 -- .../model/outer_composite.ex | 29 -- .../lib/open_api_petstore/model/outer_enum.ex | 25 - .../model/outer_enum_default_value.ex | 25 - .../model/outer_enum_integer.ex | 25 - .../model/outer_enum_integer_default_value.ex | 25 - .../elixir/lib/open_api_petstore/model/pet.ex | 38 -- .../model/read_only_first.ex | 27 -- .../lib/open_api_petstore/model/return.ex | 25 - .../lib/open_api_petstore/model/user.ex | 39 -- .../lib/open_api_petstore/request_builder.ex | 143 ------ .../elixir/lib/openapi_petstore/api/pet.ex | 3 + .../elixir/lib/openapi_petstore/connection.ex | 6 +- .../model/additional_properties_any_type.ex | 25 + .../model/additional_properties_array.ex} | 6 +- .../model/additional_properties_boolean.ex | 25 + .../model/additional_properties_class.ex | 32 +- .../model/additional_properties_integer.ex | 25 + .../model/additional_properties_number.ex} | 8 +- .../model/additional_properties_object.ex} | 8 +- .../model/additional_properties_string.ex} | 8 +- .../lib/openapi_petstore/model/animal_farm.ex | 25 - .../model/string_boolean_map.ex | 25 - samples/client/petstore/elixir/mix.exs | 14 +- samples/client/petstore/elixir/pom.xml | 13 + .../client/petstore/elixir/test/pet_test.exs | 60 +++ .../petstore/go/go-petstore/api/openapi.yaml | 9 + .../petstore/haskell-http-client/openapi.yaml | 9 + .../org/openapitools/client/api/PetApi.java | 6 + .../org/openapitools/client/api/PetApi.java | 3 + .../org/openapitools/client/api/PetApi.java | 3 + .../org/openapitools/client/api/PetApi.java | 3 + .../org/openapitools/client/api/PetApi.java | 3 + .../gen/java/org/openapitools/api/PetApi.java | 6 + .../gen/java/org/openapitools/api/PetApi.java | 3 + .../gen/java/org/openapitools/api/PetApi.java | 3 + .../gen/java/org/openapitools/api/PetApi.java | 6 + .../gen/java/org/openapitools/api/PetApi.java | 3 + .../src/main/openapi/openapi.yaml | 9 + .../gen/java/org/openapitools/api/PetApi.java | 3 + .../jaxrs-spec/src/main/openapi/openapi.yaml | 9 + .../gen/java/org/openapitools/api/PetApi.java | 3 + .../gen/java/org/openapitools/api/PetApi.java | 3 + .../gen/java/org/openapitools/api/PetApi.java | 6 + .../gen/java/org/openapitools/api/PetApi.java | 6 + .../java/org/openapitools/api/PetApi.java | 3 + .../java/org/openapitools/api/PetApi.java | 3 + .../java/org/openapitools/api/PetApi.java | 3 + .../java/org/openapitools/api/PetApi.java | 3 + .../java/org/openapitools/api/PetApi.java | 3 + .../java/org/openapitools/api/PetApi.java | 3 + .../java/org/openapitools/api/PetApi.java | 3 + .../java/org/openapitools/api/PetApi.java | 3 + .../src/main/resources/openapi.yaml | 9 + .../java/org/openapitools/api/PetApi.java | 3 + .../openapitools/virtualan/api/PetApi.java | 3 + .../java/org/openapitools/api/PetApi.java | 3 + 104 files changed, 388 insertions(+), 2750 deletions(-) delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/api/another_fake.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/api/default.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/api/fake.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/api/fake_classname_tags123.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/api/pet.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/api/store.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/api/user.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/connection.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/deserializer.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/_special_model_name_.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/additional_properties_class.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/animal.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/api_response.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_array_of_number_only.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/array_test.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/capitalization.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/cat.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/class_model.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/client.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/dog.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/enum_arrays.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/enum_test.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/file_schema_test_class.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/foo.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/format_test.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/has_only_read_only.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/health_check_result.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_1.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_2.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_3.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_4.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_5.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/inline_response_default.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/map_test.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/mixed_properties_and_additional_properties_class.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/model_200_response.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/name.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/number_only.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/order.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/outer_composite.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_default_value.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer_default_value.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/pet.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/read_only_first.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/return.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/model/user.ex delete mode 100644 samples/client/petstore/elixir/lib/open_api_petstore/request_builder.ex create mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_any_type.ex rename samples/client/petstore/elixir/lib/{open_api_petstore/model/tag.ex => openapi_petstore/model/additional_properties_array.ex} (72%) create mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_boolean.ex create mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_integer.ex rename samples/client/petstore/elixir/lib/{open_api_petstore/model/category.ex => openapi_petstore/model/additional_properties_number.ex} (65%) rename samples/client/petstore/elixir/lib/{open_api_petstore/model/array_of_number_only.ex => openapi_petstore/model/additional_properties_object.ex} (63%) rename samples/client/petstore/elixir/lib/{open_api_petstore/model/enum_class.ex => openapi_petstore/model/additional_properties_string.ex} (63%) delete mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/animal_farm.ex delete mode 100644 samples/client/petstore/elixir/lib/openapi_petstore/model/string_boolean_map.ex create mode 100644 samples/client/petstore/elixir/test/pet_test.exs diff --git a/bin/elixir-petstore.sh b/bin/elixir-petstore.sh index c4793ca2ddb..c826ea8519f 100755 --- a/bin/elixir-petstore.sh +++ b/bin/elixir-petstore.sh @@ -27,8 +27,8 @@ fi # remove existing lib and model file echo "removing existing lib, model files" -rm -Rf "samples/client/petstore/elixir/lib/swagger_petstore/model/" -rm -Rf "samples/client/petstore/elixir/lib/swagger_petstore/lib/" +rm -Rf "samples/client/petstore/elixir/lib/openapi_petstore/model/" +rm -Rf "samples/client/petstore/elixir/lib/openapi_petstore/api/" # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index 832f3cbed08..adedfa60843 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -48,6 +48,7 @@ declare -a scripts=( "./bin/r-petstore.sh" "./bin/haskell-http-client-petstore.sh" "./bin/csharp-petstore.sh" +"./bin/elixir-petstore.sh" "./bin/meta-codegen.sh" # OTHERS "./bin/utils/export_docs_generators.sh" 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 191780b6042..7f109d01a08 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 @@ -50,11 +50,11 @@ 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.4"; + String supportedElixirVersion = "1.6"; List extraApplications = Arrays.asList(":logger"); List deps = Arrays.asList( - "{:tesla, \"~> 1.0.0\"}", - "{:poison, \"~> 3.0.0\"}" + "{:tesla, \"~> 1.2\"}", + "{:poison, \"~> 3.0\"}" ); public ElixirClientCodegen() { @@ -187,6 +187,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig * @return the CodegenType for this generator * @see org.openapitools.codegen.CodegenType */ + @Override public CodegenType getTag() { return CodegenType.CLIENT; } @@ -197,6 +198,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig * * @return the friendly name for the generator */ + @Override public String getName() { return "elixir"; } @@ -207,6 +209,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig * * @return A string value for the help message */ + @Override public String getHelp() { return "Generates an elixir client library (alpha)."; } @@ -270,10 +273,10 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig public Map postProcessOperationsWithModels(Map objs, List allModels) { Map operations = (Map) super.postProcessOperationsWithModels(objs, allModels).get("operations"); List os = (List) operations.get("operation"); - List newOs = new ArrayList(); + List newOs = new ArrayList<>(); Pattern pattern = Pattern.compile("\\{([^\\}]+)\\}([^\\{]*)"); for (CodegenOperation o : os) { - ArrayList pathTemplateNames = new ArrayList(); + ArrayList pathTemplateNames = new ArrayList<>(); Matcher matcher = pattern.matcher(o.path); StringBuffer buffer = new StringBuffer(); while (matcher.find()) { @@ -328,16 +331,16 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig return buf.toString(); } - String underscored(String words) { - ArrayList underscoredWords = new ArrayList(); + private String underscored(String words) { + ArrayList underscoredWords = new ArrayList<>(); for (String word : words.split(" ")) { underscoredWords.add(underscore(word)); } return join("_", underscoredWords); } - String modulized(String words) { - ArrayList modulizedWords = new ArrayList(); + private String modulized(String words) { + ArrayList modulizedWords = new ArrayList<>(); for (String word : words.split(" ")) { modulizedWords.add(camelize(word)); } @@ -356,7 +359,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig } private String sourceFolder() { - ArrayList underscoredWords = new ArrayList(); + ArrayList underscoredWords = new ArrayList<>(); for (String word : moduleName.split("\\.")) { underscoredWords.add(underscore(word)); } @@ -367,6 +370,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig * Location to write model files. You can use the modelPackage() as defined when the class is * instantiated */ + @Override public String modelFileFolder() { return outputFolder + File.separator + sourceFolder() + File.separator + "model"; } @@ -607,7 +611,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig } class ExtendedCodegenOperation extends CodegenOperation { - private List pathTemplateNames = new ArrayList(); + private List pathTemplateNames = new ArrayList<>(); private String replacedPathName; public ExtendedCodegenOperation(CodegenOperation o) { diff --git a/modules/openapi-generator/src/main/resources/elixir/README.md.mustache b/modules/openapi-generator/src/main/resources/elixir/README.md.mustache index fbf6231983a..592b9de0043 100644 --- a/modules/openapi-generator/src/main/resources/elixir/README.md.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/README.md.mustache @@ -2,6 +2,14 @@ {{appDescription}} +### Building + +To install the required dependencies and to build the elixir project, run: +``` +mix local.hex --force +mix do deps.get, compile +``` + ## Installation If [available in Hex](https://hex.pm/docs/publish), the package can be installed diff --git a/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache b/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache index 82cfd90f48c..7fa70a2b819 100644 --- a/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache @@ -33,7 +33,7 @@ defmodule {{moduleName}}.Connection do """ @spec new(String.t) :: Tesla.Env.client def new(token) when is_binary(token) do - Tesla.build_client([ + Tesla.client([ {Tesla.Middleware.Headers, [{"authorization", "Bearer #{token}"}]} ]) end @@ -71,7 +71,7 @@ defmodule {{moduleName}}.Connection do """ @spec new(String.t, String.t) :: Tesla.Env.client def new(username, password) do - Tesla.build_client([ + Tesla.client([ {Tesla.Middleware.BasicAuth, %{username: username, password: password}} ]) end @@ -87,6 +87,6 @@ defmodule {{moduleName}}.Connection do """ @spec new() :: Tesla.Env.client def new do - Tesla.build_client([]) + Tesla.client([]) end end 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 31b458cf49f..5e77d2fc099 100644 --- a/modules/openapi-generator/src/main/resources/elixir/mix.exs.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/mix.exs.mustache @@ -3,7 +3,7 @@ defmodule {{moduleName}}.Mixfile do def project do [app: :{{#underscored}}{{packageName}}{{/underscored}}, - version: "0.1.0", + version: "{{appVersion}}", elixir: "~> {{supportedElixirVersion}}", build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, @@ -24,7 +24,7 @@ defmodule {{moduleName}}.Mixfile do # # Or git/path repositories: # - # {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} + # {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.3.0"} # # Type "mix help deps" for more examples and options defp deps do diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 8d7070b2df4..ed907f27854 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -39,6 +39,8 @@ paths: schema: $ref: '#/definitions/Pet' responses: + '200': + description: successful operation '405': description: Invalid input security: @@ -65,6 +67,8 @@ paths: schema: $ref: '#/definitions/Pet' responses: + '200': + description: successful operation '400': description: Invalid ID supplied '404': @@ -229,6 +233,8 @@ paths: type: integer format: int64 responses: + '200': + description: successful operation '400': description: Invalid pet value security: diff --git a/samples/client/petstore/elixir/README.md b/samples/client/petstore/elixir/README.md index 364c8259712..e268e77389a 100644 --- a/samples/client/petstore/elixir/README.md +++ b/samples/client/petstore/elixir/README.md @@ -1,18 +1,26 @@ -# OpenAPIPetstore +# OpenapiPetstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +### Building + +To install the required dependencies and to build the elixir project, run: +``` +mix local.hex --force +mix do deps.get, compile +``` + ## Installation If [available in Hex](https://hex.pm/docs/publish), the package can be installed -by adding `open_api_petstore` to your list of dependencies in `mix.exs`: +by adding `openapi_petstore` to your list of dependencies in `mix.exs`: ```elixir def deps do - [{:open_api_petstore, "~> 0.1.0"}] + [{:openapi_petstore, "~> 0.1.0"}] end ``` Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) and published on [HexDocs](https://hexdocs.pm). Once published, the docs can -be found at [https://hexdocs.pm/open_api_petstore](https://hexdocs.pm/open_api_petstore). +be found at [https://hexdocs.pm/openapi_petstore](https://hexdocs.pm/openapi_petstore). diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/another_fake.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/another_fake.ex deleted file mode 100644 index f968f4a9483..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/api/another_fake.ex +++ /dev/null @@ -1,40 +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.Api.AnotherFake do - @moduledoc """ - API calls for all endpoints tagged `AnotherFake`. - """ - - alias OpenAPIPetstore.Connection - import OpenAPIPetstore.RequestBuilder - - - @doc """ - To test special tags - To test special tags and operation ID starting with number - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - client (Client): client model - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %OpenAPIPetstore.Model.Client{}} on success - {:error, info} on failure - """ - @spec call_123_test_special_tags(Tesla.Env.client, OpenAPIPetstore.Model.Client.t, keyword()) :: {:ok, OpenAPIPetstore.Model.Client.t} | {:error, Tesla.Env.t} - def call_123_test_special_tags(connection, client, _opts \\ []) do - %{} - |> method(:patch) - |> url("/another-fake/dummy") - |> add_param(:body, :body, client) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.Client{}} - ]) - end -end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/default.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/default.ex deleted file mode 100644 index f8fdfc702c1..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/api/default.ex +++ /dev/null @@ -1,36 +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.Api.Default do - @moduledoc """ - API calls for all endpoints tagged `Default`. - """ - - alias OpenAPIPetstore.Connection - import OpenAPIPetstore.RequestBuilder - - - @doc """ - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %OpenAPIPetstore.Model.InlineResponseDefault{}} on success - {:error, info} on failure - """ - @spec foo_get(Tesla.Env.client, keyword()) :: {:ok, OpenAPIPetstore.Model.InlineResponseDefault.t} | {:error, Tesla.Env.t} - def foo_get(connection, _opts \\ []) do - %{} - |> method(:get) - |> url("/foo") - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { :default, %OpenAPIPetstore.Model.InlineResponseDefault{}} - ]) - end -end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/fake.ex deleted file mode 100644 index 71e4343ab38..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/api/fake.ex +++ /dev/null @@ -1,429 +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.Api.Fake do - @moduledoc """ - API calls for all endpoints tagged `Fake`. - """ - - alias OpenAPIPetstore.Connection - import OpenAPIPetstore.RequestBuilder - - - @doc """ - Health check endpoint - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %OpenAPIPetstore.Model.HealthCheckResult{}} on success - {:error, info} on failure - """ - @spec fake_health_get(Tesla.Env.client, keyword()) :: {:ok, OpenAPIPetstore.Model.HealthCheckResult.t} | {:error, Tesla.Env.t} - def fake_health_get(connection, _opts \\ []) do - %{} - |> method(:get) - |> url("/fake/health") - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.HealthCheckResult{}} - ]) - end - - @doc """ - Test serialization of outer boolean types - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - opts (KeywordList): [optional] Optional parameters - - :body (boolean()): Input boolean as post body - ## Returns - - {:ok, %OpenAPIPetstore.Model.boolean(){}} on success - {:error, info} on failure - """ - @spec fake_outer_boolean_serialize(Tesla.Env.client, keyword()) :: {:ok, Boolean.t} | {:error, Tesla.Env.t} - def fake_outer_boolean_serialize(connection, opts \\ []) do - optional_params = %{ - :"body" => :body - } - %{} - |> method(:post) - |> url("/fake/outer/boolean") - |> add_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, false} - ]) - end - - @doc """ - Test serialization of object with outer number type - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - opts (KeywordList): [optional] Optional parameters - - :outer_composite (OuterComposite): Input composite as post body - ## Returns - - {:ok, %OpenAPIPetstore.Model.OuterComposite{}} on success - {:error, info} on failure - """ - @spec fake_outer_composite_serialize(Tesla.Env.client, keyword()) :: {:ok, OpenAPIPetstore.Model.OuterComposite.t} | {:error, Tesla.Env.t} - def fake_outer_composite_serialize(connection, opts \\ []) do - optional_params = %{ - :"OuterComposite" => :body - } - %{} - |> method(:post) - |> url("/fake/outer/composite") - |> add_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.OuterComposite{}} - ]) - end - - @doc """ - Test serialization of outer number types - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - opts (KeywordList): [optional] Optional parameters - - :body (float()): Input number as post body - ## Returns - - {:ok, %OpenAPIPetstore.Model.float(){}} on success - {:error, info} on failure - """ - @spec fake_outer_number_serialize(Tesla.Env.client, keyword()) :: {:ok, Float.t} | {:error, Tesla.Env.t} - def fake_outer_number_serialize(connection, opts \\ []) do - optional_params = %{ - :"body" => :body - } - %{} - |> method(:post) - |> url("/fake/outer/number") - |> add_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, false} - ]) - end - - @doc """ - Test serialization of outer string types - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - opts (KeywordList): [optional] Optional parameters - - :body (String.t): Input string as post body - ## Returns - - {:ok, %OpenAPIPetstore.Model.String.t{}} on success - {:error, info} on failure - """ - @spec fake_outer_string_serialize(Tesla.Env.client, keyword()) :: {:ok, String.t} | {:error, Tesla.Env.t} - def fake_outer_string_serialize(connection, opts \\ []) do - optional_params = %{ - :"body" => :body - } - %{} - |> method(:post) - |> url("/fake/outer/string") - |> add_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, false} - ]) - end - - @doc """ - For this test, the body for this request much reference a schema named `File`. - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - file_schema_test_class (FileSchemaTestClass): - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec test_body_with_file_schema(Tesla.Env.client, OpenAPIPetstore.Model.FileSchemaTestClass.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def test_body_with_file_schema(connection, file_schema_test_class, _opts \\ []) do - %{} - |> method(:put) - |> url("/fake/body-with-file-schema") - |> add_param(:body, :body, file_schema_test_class) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, false} - ]) - end - - @doc """ - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - query (String.t): - - user (User): - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec test_body_with_query_params(Tesla.Env.client, String.t, OpenAPIPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def test_body_with_query_params(connection, query, user, _opts \\ []) do - %{} - |> method(:put) - |> url("/fake/body-with-query-params") - |> add_param(:query, :"query", query) - |> add_param(:body, :body, user) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, false} - ]) - end - - @doc """ - To test \"client\" model - To test \"client\" model - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - client (Client): client model - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %OpenAPIPetstore.Model.Client{}} on success - {:error, info} on failure - """ - @spec test_client_model(Tesla.Env.client, OpenAPIPetstore.Model.Client.t, keyword()) :: {:ok, OpenAPIPetstore.Model.Client.t} | {:error, Tesla.Env.t} - def test_client_model(connection, client, _opts \\ []) do - %{} - |> method(:patch) - |> url("/fake") - |> add_param(:body, :body, client) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.Client{}} - ]) - end - - @doc """ - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - number (float()): None - - double (float()): None - - pattern_without_delimiter (String.t): None - - byte (binary()): None - - opts (KeywordList): [optional] Optional parameters - - :integer (integer()): None - - :int32 (integer()): None - - :int64 (integer()): None - - :float (float()): None - - :string (String.t): None - - :binary (String.t): None - - :date (Date.t): None - - :date_time (DateTime.t): None - - :password (String.t): None - - :callback (String.t): None - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @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 - } - %{} - |> 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_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 400, false}, - { 404, false} - ]) - end - - @doc """ - To test enum parameters - To test enum parameters - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - opts (KeywordList): [optional] Optional parameters - - :enum_header_string_array ([String.t]): Header parameter enum test (string array) - - :enum_header_string (String.t): Header parameter enum test (string) - - :enum_query_string_array ([String.t]): Query parameter enum test (string array) - - :enum_query_string (String.t): Query parameter enum test (string) - - :enum_query_integer (integer()): Query parameter enum test (double) - - :enum_query_double (float()): Query parameter enum test (double) - - :enum_form_string_array ([String.t]): Form parameter enum test (string array) - - :enum_form_string (String.t): Form parameter enum test (string) - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @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_form_string_array" => :form, - :"enum_form_string" => :form - } - %{} - |> method(:get) - |> url("/fake") - |> add_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 400, false}, - { 404, false} - ]) - end - - @doc """ - Fake endpoint to test group parameters (optional) - Fake endpoint to test group parameters (optional) - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - required_string_group (integer()): Required String in group parameters - - required_boolean_group (boolean()): Required Boolean in group parameters - - required_int64_group (integer()): Required Integer in group parameters - - opts (KeywordList): [optional] Optional parameters - - :string_group (integer()): String in group parameters - - :boolean_group (boolean()): Boolean in group parameters - - :int64_group (integer()): Integer in group parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @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 - } - %{} - |> 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_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 400, false} - ]) - end - - @doc """ - test inline additionalProperties - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - request_body (%{optional(String.t) => String.t}): request body - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec test_inline_additional_properties(Tesla.Env.client, %{optional(String.t) => String.t}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def test_inline_additional_properties(connection, request_body, _opts \\ []) do - %{} - |> method(:post) - |> url("/fake/inline-additionalProperties") - |> add_param(:body, :body, request_body) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, false} - ]) - end - - @doc """ - test json serialization of form data - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - param (String.t): field1 - - param2 (String.t): field2 - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec test_json_form_data(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def test_json_form_data(connection, param, param2, _opts \\ []) do - %{} - |> method(:get) - |> url("/fake/jsonFormData") - |> add_param(:form, :"param", param) - |> add_param(:form, :"param2", param2) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, false} - ]) - end -end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/fake_classname_tags123.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/fake_classname_tags123.ex deleted file mode 100644 index 342834b4280..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/api/fake_classname_tags123.ex +++ /dev/null @@ -1,40 +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.Api.FakeClassnameTags123 do - @moduledoc """ - API calls for all endpoints tagged `FakeClassnameTags123`. - """ - - alias OpenAPIPetstore.Connection - import OpenAPIPetstore.RequestBuilder - - - @doc """ - To test class name in snake case - To test class name in snake case - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - client (Client): client model - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %OpenAPIPetstore.Model.Client{}} on success - {:error, info} on failure - """ - @spec test_classname(Tesla.Env.client, OpenAPIPetstore.Model.Client.t, keyword()) :: {:ok, OpenAPIPetstore.Model.Client.t} | {:error, Tesla.Env.t} - def test_classname(connection, client, _opts \\ []) do - %{} - |> method(:patch) - |> url("/fake_classname_test") - |> add_param(:body, :body, client) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.Client{}} - ]) - end -end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/pet.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/pet.ex deleted file mode 100644 index a99e7feac96..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/api/pet.ex +++ /dev/null @@ -1,277 +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.Api.Pet do - @moduledoc """ - API calls for all endpoints tagged `Pet`. - """ - - alias OpenAPIPetstore.Connection - import OpenAPIPetstore.RequestBuilder - - - @doc """ - Add a new pet to the store - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - pet (Pet): Pet object that needs to be added to the store - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec add_pet(Tesla.Env.client, OpenAPIPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def add_pet(connection, pet, _opts \\ []) do - %{} - |> method(:post) - |> url("/pet") - |> add_param(:body, :body, pet) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 405, false} - ]) - end - - @doc """ - Deletes a pet - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - pet_id (integer()): Pet id to delete - - opts (KeywordList): [optional] Optional parameters - - :api_key (String.t): - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @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 - } - %{} - |> method(:delete) - |> url("/pet/#{pet_id}") - |> add_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 400, false} - ]) - end - - @doc """ - Finds Pets by status - Multiple status values can be provided with comma separated strings - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - status ([String.t]): Status values that need to be considered for filter - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, [%Pet{}, ...]} on success - {:error, info} on failure - """ - @spec find_pets_by_status(Tesla.Env.client, list(String.t), keyword()) :: {:ok, list(OpenAPIPetstore.Model.Pet.t)} | {:error, Tesla.Env.t} - def find_pets_by_status(connection, status, _opts \\ []) do - %{} - |> method(:get) - |> url("/pet/findByStatus") - |> add_param(:query, :"status", status) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, [%OpenAPIPetstore.Model.Pet{}]}, - { 400, false} - ]) - end - - @doc """ - Finds Pets by tags - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - tags ([String.t]): Tags to filter by - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, [%Pet{}, ...]} on success - {:error, info} on failure - """ - @spec find_pets_by_tags(Tesla.Env.client, list(String.t), keyword()) :: {:ok, list(OpenAPIPetstore.Model.Pet.t)} | {:error, Tesla.Env.t} - def find_pets_by_tags(connection, tags, _opts \\ []) do - %{} - |> method(:get) - |> url("/pet/findByTags") - |> add_param(:query, :"tags", tags) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, [%OpenAPIPetstore.Model.Pet{}]}, - { 400, false} - ]) - end - - @doc """ - Find pet by ID - Returns a single pet - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - pet_id (integer()): ID of pet to return - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %OpenAPIPetstore.Model.Pet{}} on success - {:error, info} on failure - """ - @spec get_pet_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, OpenAPIPetstore.Model.Pet.t} | {:error, Tesla.Env.t} - def get_pet_by_id(connection, pet_id, _opts \\ []) do - %{} - |> method(:get) - |> url("/pet/#{pet_id}") - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.Pet{}}, - { 400, false}, - { 404, false} - ]) - end - - @doc """ - Update an existing pet - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - pet (Pet): Pet object that needs to be added to the store - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec update_pet(Tesla.Env.client, OpenAPIPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def update_pet(connection, pet, _opts \\ []) do - %{} - |> method(:put) - |> url("/pet") - |> add_param(:body, :body, pet) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 400, false}, - { 404, false}, - { 405, false} - ]) - end - - @doc """ - Updates a pet in the store with form data - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - pet_id (integer()): ID of pet that needs to be updated - - opts (KeywordList): [optional] Optional parameters - - :name (String.t): Updated name of the pet - - :status (String.t): Updated status of the pet - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @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 - } - %{} - |> method(:post) - |> url("/pet/#{pet_id}") - |> add_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 405, false} - ]) - end - - @doc """ - uploads an image - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - pet_id (integer()): ID of pet to update - - opts (KeywordList): [optional] Optional parameters - - :additional_metadata (String.t): Additional data to pass to server - - :file (String.t): file to upload - ## Returns - - {:ok, %OpenAPIPetstore.Model.ApiResponse{}} on success - {:error, info} on failure - """ - @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 - } - %{} - |> method(:post) - |> url("/pet/#{pet_id}/uploadImage") - |> add_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.ApiResponse{}} - ]) - end - - @doc """ - uploads an image (required) - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - pet_id (integer()): ID of pet to update - - required_file (String.t): file to upload - - opts (KeywordList): [optional] Optional parameters - - :additional_metadata (String.t): Additional data to pass to server - ## Returns - - {:ok, %OpenAPIPetstore.Model.ApiResponse{}} on success - {:error, info} on failure - """ - @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 - } - %{} - |> method(:post) - |> url("/fake/#{pet_id}/uploadImageWithRequiredFile") - |> add_param(:file, :"requiredFile", required_file) - |> add_optional_params(optional_params, opts) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.ApiResponse{}} - ]) - end -end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/store.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/store.ex deleted file mode 100644 index 843f2d5ecbf..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/api/store.ex +++ /dev/null @@ -1,120 +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.Api.Store do - @moduledoc """ - API calls for all endpoints tagged `Store`. - """ - - alias OpenAPIPetstore.Connection - import OpenAPIPetstore.RequestBuilder - - - @doc """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - order_id (String.t): ID of the order that needs to be deleted - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec delete_order(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def delete_order(connection, order_id, _opts \\ []) do - %{} - |> method(:delete) - |> url("/store/order/#{order_id}") - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 400, false}, - { 404, false} - ]) - end - - @doc """ - Returns pet inventories by status - Returns a map of status codes to quantities - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec get_inventory(Tesla.Env.client, keyword()) :: {:ok, map()} | {:error, Tesla.Env.t} - def get_inventory(connection, _opts \\ []) do - %{} - |> method(:get) - |> url("/store/inventory") - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %{}} - ]) - end - - @doc """ - Find purchase order by ID - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - order_id (integer()): ID of pet that needs to be fetched - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %OpenAPIPetstore.Model.Order{}} on success - {:error, info} on failure - """ - @spec get_order_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, OpenAPIPetstore.Model.Order.t} | {:error, Tesla.Env.t} - def get_order_by_id(connection, order_id, _opts \\ []) do - %{} - |> method(:get) - |> url("/store/order/#{order_id}") - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.Order{}}, - { 400, false}, - { 404, false} - ]) - end - - @doc """ - Place an order for a pet - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - order (Order): order placed for purchasing the pet - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %OpenAPIPetstore.Model.Order{}} on success - {:error, info} on failure - """ - @spec place_order(Tesla.Env.client, OpenAPIPetstore.Model.Order.t, keyword()) :: {:ok, OpenAPIPetstore.Model.Order.t} | {:error, Tesla.Env.t} - def place_order(connection, order, _opts \\ []) do - %{} - |> method(:post) - |> url("/store/order") - |> add_param(:body, :body, order) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.Order{}}, - { 400, false} - ]) - end -end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/api/user.ex b/samples/client/petstore/elixir/lib/open_api_petstore/api/user.ex deleted file mode 100644 index ce8eaeea6bc..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/api/user.ex +++ /dev/null @@ -1,228 +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.Api.User do - @moduledoc """ - API calls for all endpoints tagged `User`. - """ - - alias OpenAPIPetstore.Connection - import OpenAPIPetstore.RequestBuilder - - - @doc """ - Create user - This can only be done by the logged in user. - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - user (User): Created user object - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec create_user(Tesla.Env.client, OpenAPIPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def create_user(connection, user, _opts \\ []) do - %{} - |> method(:post) - |> url("/user") - |> add_param(:body, :body, user) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { :default, false} - ]) - end - - @doc """ - Creates list of users with given input array - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - user ([User]): List of user object - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec create_users_with_array_input(Tesla.Env.client, list(OpenAPIPetstore.Model.User.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def create_users_with_array_input(connection, user, _opts \\ []) do - %{} - |> method(:post) - |> url("/user/createWithArray") - |> add_param(:body, :body, user) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { :default, false} - ]) - end - - @doc """ - Creates list of users with given input array - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - user ([User]): List of user object - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec create_users_with_list_input(Tesla.Env.client, list(OpenAPIPetstore.Model.User.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def create_users_with_list_input(connection, user, _opts \\ []) do - %{} - |> method(:post) - |> url("/user/createWithList") - |> add_param(:body, :body, user) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { :default, false} - ]) - end - - @doc """ - Delete user - This can only be done by the logged in user. - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - username (String.t): The name that needs to be deleted - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec delete_user(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def delete_user(connection, username, _opts \\ []) do - %{} - |> method(:delete) - |> url("/user/#{username}") - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 400, false}, - { 404, false} - ]) - end - - @doc """ - Get user by user name - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - username (String.t): The name that needs to be fetched. Use user1 for testing. - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %OpenAPIPetstore.Model.User{}} on success - {:error, info} on failure - """ - @spec get_user_by_name(Tesla.Env.client, String.t, keyword()) :: {:ok, OpenAPIPetstore.Model.User.t} | {:error, Tesla.Env.t} - def get_user_by_name(connection, username, _opts \\ []) do - %{} - |> method(:get) - |> url("/user/#{username}") - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, %OpenAPIPetstore.Model.User{}}, - { 400, false}, - { 404, false} - ]) - end - - @doc """ - Logs user into the system - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - username (String.t): The user name for login - - password (String.t): The password for login in clear text - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %OpenAPIPetstore.Model.String.t{}} on success - {:error, info} on failure - """ - @spec login_user(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, String.t} | {:error, Tesla.Env.t} - def login_user(connection, username, password, _opts \\ []) do - %{} - |> method(:get) - |> url("/user/login") - |> add_param(:query, :"username", username) - |> add_param(:query, :"password", password) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 200, false}, - { 400, false} - ]) - end - - @doc """ - Logs out current logged in user session - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec logout_user(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def logout_user(connection, _opts \\ []) do - %{} - |> method(:get) - |> url("/user/logout") - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { :default, false} - ]) - end - - @doc """ - Updated user - This can only be done by the logged in user. - - ## Parameters - - - connection (OpenAPIPetstore.Connection): Connection to server - - username (String.t): name that need to be deleted - - user (User): Updated user object - - opts (KeywordList): [optional] Optional parameters - ## Returns - - {:ok, %{}} on success - {:error, info} on failure - """ - @spec update_user(Tesla.Env.client, String.t, OpenAPIPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def update_user(connection, username, user, _opts \\ []) do - %{} - |> method(:put) - |> url("/user/#{username}") - |> add_param(:body, :body, user) - |> Enum.into([]) - |> (&Connection.request(connection, &1)).() - |> evaluate_response([ - { 400, false}, - { 404, false} - ]) - end -end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/connection.ex b/samples/client/petstore/elixir/lib/open_api_petstore/connection.ex deleted file mode 100644 index 013f2accf11..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/connection.ex +++ /dev/null @@ -1,104 +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.Connection do - @moduledoc """ - Handle Tesla connections for OpenAPIPetstore. - """ - - use Tesla - - # Add any middleware here (authentication) - plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" - plug Tesla.Middleware.Headers, [{"user-agent", "Elixir"}] - plug Tesla.Middleware.EncodeJson, engine: Poison - - @doc """ - Configure a client connection using Basic authentication. - - ## Parameters - - - username (String): Username used for authentication - - password (String): Password used for authentication - - # Returns - - Tesla.Env.client - """ - @spec new(String.t, String.t) :: Tesla.Env.client - def new(username, password) do - Tesla.build_client([ - {Tesla.Middleware.BasicAuth, %{username: username, password: password}} - ]) - end - @doc """ - Configure a client connection using Basic authentication. - - ## Parameters - - - username (String): Username used for authentication - - password (String): Password used for authentication - - # Returns - - Tesla.Env.client - """ - @spec new(String.t, String.t) :: Tesla.Env.client - def new(username, password) do - Tesla.build_client([ - {Tesla.Middleware.BasicAuth, %{username: username, password: password}} - ]) - end - @scopes [ - "write:pets", # modify pets in your account - "read:pets" # read your pets - ] - - @doc """ - Configure a client connection using a provided OAuth2 token as a Bearer token - - ## Parameters - - - token (String): Bearer token - - ## Returns - - Tesla.Env.client - """ - @spec new(String.t) :: Tesla.Env.client - def new(token) when is_binary(token) do - Tesla.build_client([ - {Tesla.Middleware.Headers, [{"authorization", "Bearer #{token}"}]} - ]) - end - - @doc """ - Configure a client connection using a function which yields a Bearer token. - - ## Parameters - - - token_fetcher (function arity of 1): Callback which provides an OAuth2 token - given a list of scopes - - ## Returns - - Tesla.Env.client - """ - @spec new(((list(String.t)) -> String.t)) :: Tesla.Env.client - def new(token_fetcher) when is_function(token_fetcher) do - token_fetcher.(@scopes) - |> new - end - @doc """ - Configure an authless client connection - - # Returns - - Tesla.Env.client - """ - @spec new() :: Tesla.Env.client - def new do - Tesla.build_client([]) - end -end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/deserializer.ex b/samples/client/petstore/elixir/lib/open_api_petstore/deserializer.ex deleted file mode 100644 index 9df2c684c18..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/deserializer.ex +++ /dev/null @@ -1,38 +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.Deserializer do - @moduledoc """ - Helper functions for deserializing responses into models - """ - - @doc """ - Update the provided model with a deserialization of a nested value - """ - @spec deserialize(struct(), :atom, :atom, struct(), keyword()) :: struct() - def deserialize(model, field, :list, mod, options) do - model - |> Map.update!(field, &(Poison.Decode.decode(&1, Keyword.merge(options, [as: [struct(mod)]])))) - end - def deserialize(model, field, :struct, mod, options) do - model - |> Map.update!(field, &(Poison.Decode.decode(&1, Keyword.merge(options, [as: struct(mod)])))) - end - def deserialize(model, field, :map, mod, options) do - model - |> Map.update!(field, &(Map.new(&1, fn {key, val} -> {key, Poison.Decode.decode(val, Keyword.merge(options, [as: struct(mod)]))} end))) - end - def deserialize(model, field, :date, _, _options) do - value = Map.get(model, field) - case is_binary(value) do - true -> case DateTime.from_iso8601(value) do - {:ok, datetime, _offset} -> - Map.put(model, field, datetime) - _ -> - model - end - false -> model - end - end -end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/_special_model_name_.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/_special_model_name_.ex deleted file mode 100644 index 373453229f6..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_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/open_api_petstore/model/additional_properties_class.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/additional_properties_class.ex deleted file mode 100644 index 79044681583..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/additional_properties_class.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.AdditionalPropertiesClass do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"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 - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.AdditionalPropertiesClass do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/animal.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/animal.ex deleted file mode 100644 index 528a9004b2f..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/animal.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.Animal do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"className", - :"color" - ] - - @type t :: %__MODULE__{ - :"className" => String.t, - :"color" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Animal do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/api_response.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/api_response.ex deleted file mode 100644 index 5d23292c2d6..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/api_response.ex +++ /dev/null @@ -1,29 +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.ApiResponse do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"code", - :"type", - :"message" - ] - - @type t :: %__MODULE__{ - :"code" => integer() | nil, - :"type" => String.t | nil, - :"message" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ApiResponse do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_array_of_number_only.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_array_of_number_only.ex deleted file mode 100644 index 940e950c4d5..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_array_of_number_only.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.ArrayOfArrayOfNumberOnly do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"ArrayArrayNumber" - ] - - @type t :: %__MODULE__{ - :"ArrayArrayNumber" => [[float()]] | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ArrayOfArrayOfNumberOnly do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/array_test.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/array_test.ex deleted file mode 100644 index f5e71645ff1..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/array_test.ex +++ /dev/null @@ -1,29 +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.ArrayTest do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"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" => [[ReadOnlyFirst]] | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ArrayTest do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/capitalization.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/capitalization.ex deleted file mode 100644 index 1add3224034..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/capitalization.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.Capitalization do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"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 - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Capitalization do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/cat.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/cat.ex deleted file mode 100644 index ab89301e1ef..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/cat.ex +++ /dev/null @@ -1,29 +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.Cat do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"className", - :"color", - :"declawed" - ] - - @type t :: %__MODULE__{ - :"className" => String.t, - :"color" => String.t | nil, - :"declawed" => boolean() | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Cat do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/class_model.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/class_model.ex deleted file mode 100644 index c41f3d3921f..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/class_model.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.ClassModel do - @moduledoc """ - Model for testing model with \"_class\" property - """ - - @derive [Poison.Encoder] - defstruct [ - :"_class" - ] - - @type t :: %__MODULE__{ - :"_class" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ClassModel do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/client.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/client.ex deleted file mode 100644 index f94164d85fb..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/client.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.Client do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"client" - ] - - @type t :: %__MODULE__{ - :"client" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Client do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/dog.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/dog.ex deleted file mode 100644 index 03d874be2bb..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/dog.ex +++ /dev/null @@ -1,29 +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.Dog do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"className", - :"color", - :"breed" - ] - - @type t :: %__MODULE__{ - :"className" => String.t, - :"color" => String.t | nil, - :"breed" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Dog do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_arrays.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_arrays.ex deleted file mode 100644 index 119f3d737a1..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_arrays.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.EnumArrays do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"just_symbol", - :"array_enum" - ] - - @type t :: %__MODULE__{ - :"just_symbol" => String.t | nil, - :"array_enum" => [String.t] | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.EnumArrays do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_test.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_test.ex deleted file mode 100644 index ccdedcda945..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_test.ex +++ /dev/null @@ -1,44 +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.EnumTest do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"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" => OuterEnum | nil, - :"outerEnumInteger" => OuterEnumInteger | nil, - :"outerEnumDefaultValue" => OuterEnumDefaultValue | nil, - :"outerEnumIntegerDefaultValue" => OuterEnumIntegerDefaultValue | nil - } -end - -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) - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/file_schema_test_class.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/file_schema_test_class.ex deleted file mode 100644 index 09aacc33267..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/file_schema_test_class.ex +++ /dev/null @@ -1,30 +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.FileSchemaTestClass do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"file", - :"files" - ] - - @type t :: %__MODULE__{ - :"file" => File | nil, - :"files" => [File] | nil - } -end - -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) - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/foo.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/foo.ex deleted file mode 100644 index 4d98049f353..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/foo.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.Foo do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"bar" - ] - - @type t :: %__MODULE__{ - :"bar" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Foo do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/format_test.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/format_test.ex deleted file mode 100644 index e05f7f5695d..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/format_test.ex +++ /dev/null @@ -1,55 +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.FormatTest do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"integer", - :"int32", - :"int64", - :"number", - :"float", - :"double", - :"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, - :"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 - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.FormatTest do - import OpenAPIPetstore.Deserializer - def decode(value, options) do - value - |> deserialize(:"date", :date, nil, options) - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/has_only_read_only.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/has_only_read_only.ex deleted file mode 100644 index 3bae7f8c51f..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/has_only_read_only.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.HasOnlyReadOnly do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"bar", - :"foo" - ] - - @type t :: %__MODULE__{ - :"bar" => String.t | nil, - :"foo" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.HasOnlyReadOnly do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/health_check_result.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/health_check_result.ex deleted file mode 100644 index f216ae34f3a..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/health_check_result.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.HealthCheckResult do - @moduledoc """ - Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - """ - - @derive [Poison.Encoder] - defstruct [ - :"NullableMessage" - ] - - @type t :: %__MODULE__{ - :"NullableMessage" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.HealthCheckResult do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object.ex deleted file mode 100644 index ca71f7bf816..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object.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.InlineObject do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"name", - :"status" - ] - - @type t :: %__MODULE__{ - :"name" => String.t | nil, - :"status" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_1.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_1.ex deleted file mode 100644 index aa20fd9d24b..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_1.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.InlineObject1 do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"additionalMetadata", - :"file" - ] - - @type t :: %__MODULE__{ - :"additionalMetadata" => String.t | nil, - :"file" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject1 do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_2.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_2.ex deleted file mode 100644 index 3ba98005e75..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_2.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.InlineObject2 do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"enum_form_string_array", - :"enum_form_string" - ] - - @type t :: %__MODULE__{ - :"enum_form_string_array" => [String.t] | nil, - :"enum_form_string" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject2 do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_3.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_3.ex deleted file mode 100644 index 228f01e533d..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_3.ex +++ /dev/null @@ -1,53 +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.InlineObject3 do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"integer", - :"int32", - :"int64", - :"number", - :"float", - :"double", - :"string", - :"pattern_without_delimiter", - :"byte", - :"binary", - :"date", - :"dateTime", - :"password", - :"callback" - ] - - @type t :: %__MODULE__{ - :"integer" => integer() | nil, - :"int32" => integer() | nil, - :"int64" => integer() | nil, - :"number" => float(), - :"float" => float() | nil, - :"double" => float(), - :"string" => String.t | nil, - :"pattern_without_delimiter" => String.t, - :"byte" => binary(), - :"binary" => String.t | nil, - :"date" => Date.t | nil, - :"dateTime" => DateTime.t | nil, - :"password" => String.t | nil, - :"callback" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject3 do - import OpenAPIPetstore.Deserializer - def decode(value, options) do - value - |> deserialize(:"date", :date, nil, options) - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_4.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_4.ex deleted file mode 100644 index 44d61987520..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_4.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.InlineObject4 do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"param", - :"param2" - ] - - @type t :: %__MODULE__{ - :"param" => String.t, - :"param2" => String.t - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject4 do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_5.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_5.ex deleted file mode 100644 index 81d14770447..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_object_5.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.InlineObject5 do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"additionalMetadata", - :"requiredFile" - ] - - @type t :: %__MODULE__{ - :"additionalMetadata" => String.t | nil, - :"requiredFile" => String.t - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject5 do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_response_default.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/inline_response_default.ex deleted file mode 100644 index 69558317475..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_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" => Foo | 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/open_api_petstore/model/map_test.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/map_test.ex deleted file mode 100644 index 0a196a715a6..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/map_test.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.MapTest do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"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 - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.MapTest do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/mixed_properties_and_additional_properties_class.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/mixed_properties_and_additional_properties_class.ex deleted file mode 100644 index 3285b9bf222..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/mixed_properties_and_additional_properties_class.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.MixedPropertiesAndAdditionalPropertiesClass do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"uuid", - :"dateTime", - :"map" - ] - - @type t :: %__MODULE__{ - :"uuid" => String.t | nil, - :"dateTime" => DateTime.t | nil, - :"map" => %{optional(String.t) => Animal} | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do - import OpenAPIPetstore.Deserializer - def decode(value, options) do - value - |> deserialize(:"map", :map, OpenAPIPetstore.Model.Animal, options) - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/model_200_response.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/model_200_response.ex deleted file mode 100644 index 4b8b9222d84..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/model_200_response.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.Model200Response do - @moduledoc """ - Model for testing model name starting with number - """ - - @derive [Poison.Encoder] - defstruct [ - :"name", - :"class" - ] - - @type t :: %__MODULE__{ - :"name" => integer() | nil, - :"class" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Model200Response do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/name.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/name.ex deleted file mode 100644 index 0c1928c9fd9..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/name.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.Name do - @moduledoc """ - Model for testing model name same as property name - """ - - @derive [Poison.Encoder] - defstruct [ - :"name", - :"snake_case", - :"property", - :"123Number" - ] - - @type t :: %__MODULE__{ - :"name" => integer(), - :"snake_case" => integer() | nil, - :"property" => String.t | nil, - :"123Number" => integer() | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Name do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/number_only.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/number_only.ex deleted file mode 100644 index 30a3f986186..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/number_only.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.NumberOnly do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"JustNumber" - ] - - @type t :: %__MODULE__{ - :"JustNumber" => float() | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.NumberOnly do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/order.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/order.ex deleted file mode 100644 index 40bb39f6207..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/order.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.Order do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"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 - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Order do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_composite.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_composite.ex deleted file mode 100644 index 4c1d4816303..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_composite.ex +++ /dev/null @@ -1,29 +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.OuterComposite do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"my_number", - :"my_string", - :"my_boolean" - ] - - @type t :: %__MODULE__{ - :"my_number" => float() | nil, - :"my_string" => String.t | nil, - :"my_boolean" => boolean() | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterComposite do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum.ex deleted file mode 100644 index f818a4aec40..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum.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.OuterEnum do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - - ] - - @type t :: %__MODULE__{ - - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterEnum do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_default_value.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_default_value.ex deleted file mode 100644 index d2c2f87157b..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_default_value.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.OuterEnumDefaultValue do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - - ] - - @type t :: %__MODULE__{ - - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterEnumDefaultValue do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer.ex deleted file mode 100644 index 53646faecd0..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_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.OuterEnumInteger do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - - ] - - @type t :: %__MODULE__{ - - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterEnumInteger do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer_default_value.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer_default_value.ex deleted file mode 100644 index afedabe42a6..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/outer_enum_integer_default_value.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.OuterEnumIntegerDefaultValue do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - - ] - - @type t :: %__MODULE__{ - - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterEnumIntegerDefaultValue do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/pet.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/pet.ex deleted file mode 100644 index 844b3182650..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/pet.ex +++ /dev/null @@ -1,38 +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.Pet do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"id", - :"category", - :"name", - :"photoUrls", - :"tags", - :"status" - ] - - @type t :: %__MODULE__{ - :"id" => integer() | nil, - :"category" => Category | nil, - :"name" => String.t, - :"photoUrls" => [String.t], - :"tags" => [Tag] | nil, - :"status" => String.t | nil - } -end - -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) - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/read_only_first.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/read_only_first.ex deleted file mode 100644 index 9ce08c2f520..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/read_only_first.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.ReadOnlyFirst do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"bar", - :"baz" - ] - - @type t :: %__MODULE__{ - :"bar" => String.t | nil, - :"baz" => String.t | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ReadOnlyFirst do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/return.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/return.ex deleted file mode 100644 index 306421e2c3a..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/return.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.Return do - @moduledoc """ - Model for testing reserved words - """ - - @derive [Poison.Encoder] - defstruct [ - :"return" - ] - - @type t :: %__MODULE__{ - :"return" => integer() | nil - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Return do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/user.ex b/samples/client/petstore/elixir/lib/open_api_petstore/model/user.ex deleted file mode 100644 index 33afc4d24e5..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/user.ex +++ /dev/null @@ -1,39 +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.User do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - :"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 - } -end - -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.User do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/request_builder.ex b/samples/client/petstore/elixir/lib/open_api_petstore/request_builder.ex deleted file mode 100644 index 5366cc86c20..00000000000 --- a/samples/client/petstore/elixir/lib/open_api_petstore/request_builder.ex +++ /dev/null @@ -1,143 +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.RequestBuilder do - @moduledoc """ - Helper functions for building Tesla requests - """ - - @doc """ - Specify the request method when building a request - - ## Parameters - - - request (Map) - Collected request options - - m (atom) - Request method - - ## Returns - - Map - """ - @spec method(map(), atom) :: map() - def method(request, m) do - Map.put_new(request, :method, m) - end - - @doc """ - Specify the request method when building a request - - ## Parameters - - - request (Map) - Collected request options - - u (String) - Request URL - - ## Returns - - Map - """ - @spec url(map(), String.t) :: map() - def url(request, u) do - Map.put_new(request, :url, u) - end - - @doc """ - Add optional parameters to the request - - ## Parameters - - - request (Map) - Collected request options - - definitions (Map) - Map of parameter name to parameter location. - - options (KeywordList) - The provided optional parameters - - ## Returns - - Map - """ - @spec add_optional_params(map(), %{optional(atom) => atom}, keyword()) :: map() - def add_optional_params(request, _, []), do: request - def add_optional_params(request, definitions, [{key, value} | tail]) do - case definitions do - %{^key => location} -> - request - |> add_param(location, key, value) - |> add_optional_params(definitions, tail) - _ -> - add_optional_params(request, definitions, tail) - end - end - - @doc """ - Add optional parameters to the request - - ## Parameters - - - request (Map) - Collected request options - - location (atom) - Where to put the parameter - - key (atom) - The name of the parameter - - value (any) - The value of the parameter - - ## Returns - - Map - """ - @spec add_param(map(), atom, atom, any()) :: map() - def add_param(request, :body, :body, value), do: Map.put(request, :body, value) - def add_param(request, :body, key, value) do - request - |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) - |> Map.update!(:body, &(Tesla.Multipart.add_field(&1, key, Poison.encode!(value), headers: [{:"Content-Type", "application/json"}]))) - end - def add_param(request, :headers, key, value) do - request - |> Tesla.put_header(key, value) - end - def add_param(request, :file, name, path) do - request - |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) - |> Map.update!(:body, &(Tesla.Multipart.add_file(&1, path, name: name))) - end - def add_param(request, :form, name, value) do - request - |> Map.update(:body, %{name => value}, &(Map.put(&1, name, value))) - end - def add_param(request, location, key, value) do - Map.update(request, location, [{key, value}], &(&1 ++ [{key, value}])) - end - - @doc """ - Handle the response for a Tesla request - - ## Parameters - - - arg1 (Tesla.Env.t | term) - The response object - - arg2 (:false | struct | [struct]) - The shape of the struct to deserialize into - - ## Returns - - {:ok, struct} on success - {:error, term} on failure - """ - @spec decode(Tesla.Env.t() | term(), false | struct() | [struct()]) :: - {:ok, struct()} | {:ok, Tesla.Env.t()} | {:error, any} - def decode(%Tesla.Env{} = env, false), do: {:ok, env} - def decode(%Tesla.Env{body: body}, struct), do: Poison.decode(body, as: struct) - - def evaluate_response({:ok, %Tesla.Env{} = env}, mapping) do - resolve_mapping(env, mapping) - end - - def evaluate_response({:error, _} = error, _), do: error - - def resolve_mapping(env, mapping, default \\ nil) - - def resolve_mapping(%Tesla.Env{status: status} = env, [{mapping_status, struct} | _], _) - when status == mapping_status do - decode(env, struct) - end - - def resolve_mapping(env, [{:default, struct} | tail], _), do: resolve_mapping(env, tail, struct) - def resolve_mapping(env, [_ | tail], struct), do: resolve_mapping(env, tail, struct) - def resolve_mapping(env, [], nil), do: {:error, env} - def resolve_mapping(env, [], struct), do: decode(env, struct) -end 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 9d173ba9625..85c04b4d403 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex @@ -33,6 +33,7 @@ defmodule OpenapiPetstore.Api.Pet do |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ + { 200, false}, { 405, false} ]) end @@ -63,6 +64,7 @@ defmodule OpenapiPetstore.Api.Pet do |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ + { 200, false}, { 400, false} ]) end @@ -173,6 +175,7 @@ defmodule OpenapiPetstore.Api.Pet do |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ + { 200, false}, { 400, false}, { 404, false}, { 405, false} diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/connection.ex b/samples/client/petstore/elixir/lib/openapi_petstore/connection.ex index c44015b7f80..eddf86c2f8b 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/connection.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/connection.ex @@ -28,7 +28,7 @@ defmodule OpenapiPetstore.Connection do """ @spec new(String.t, String.t) :: Tesla.Env.client def new(username, password) do - Tesla.build_client([ + Tesla.client([ {Tesla.Middleware.BasicAuth, %{username: username, password: password}} ]) end @@ -50,7 +50,7 @@ defmodule OpenapiPetstore.Connection do """ @spec new(String.t) :: Tesla.Env.client def new(token) when is_binary(token) do - Tesla.build_client([ + Tesla.client([ {Tesla.Middleware.Headers, [{"authorization", "Bearer #{token}"}]} ]) end @@ -81,6 +81,6 @@ defmodule OpenapiPetstore.Connection do """ @spec new() :: Tesla.Env.client def new do - Tesla.build_client([]) + Tesla.client([]) 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 new file mode 100644 index 00000000000..36cc16ce42e --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_any_type.ex @@ -0,0 +1,25 @@ +# 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/open_api_petstore/model/tag.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_array.ex similarity index 72% rename from samples/client/petstore/elixir/lib/open_api_petstore/model/tag.ex rename to samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_array.ex index b7d28a0c7c3..5279e66ad78 100644 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/tag.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_array.ex @@ -2,24 +2,22 @@ # https://openapi-generator.tech # Do not edit the class manually. -defmodule OpenAPIPetstore.Model.Tag do +defmodule OpenapiPetstore.Model.AdditionalPropertiesArray do @moduledoc """ """ @derive [Poison.Encoder] defstruct [ - :"id", :"name" ] @type t :: %__MODULE__{ - :"id" => integer() | nil, :"name" => String.t | nil } end -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Tag do +defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesArray do def decode(value, _options) do value 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 new file mode 100644 index 00000000000..3a338e6b05c --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_boolean.ex @@ -0,0 +1,25 @@ +# 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 837bf62a7ce..f7471d3757b 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,19 +9,41 @@ defmodule OpenapiPetstore.Model.AdditionalPropertiesClass do @derive [Poison.Encoder] defstruct [ - :"map_property", - :"map_of_map_property" + :"map_string", + :"map_number", + :"map_integer", + :"map_boolean", + :"map_array_integer", + :"map_array_anytype", + :"map_map_string", + :"map_map_anytype", + :"anytype_1", + :"anytype_2", + :"anytype_3" ] @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_string" => %{optional(String.t) => String.t} | nil, + :"map_number" => %{optional(String.t) => float()} | nil, + :"map_integer" => %{optional(String.t) => integer()} | nil, + :"map_boolean" => %{optional(String.t) => boolean()} | nil, + :"map_array_integer" => %{optional(String.t) => [integer()]} | nil, + :"map_array_anytype" => %{optional(String.t) => [Map]} | nil, + :"map_map_string" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil, + :"map_map_anytype" => %{optional(String.t) => %{optional(String.t) => Map}} | nil, + :"anytype_1" => Map | nil, + :"anytype_2" => Map | nil, + :"anytype_3" => Map | nil } end defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesClass do - def decode(value, _options) do + import OpenapiPetstore.Deserializer + def decode(value, options) do value + |> deserialize(:"anytype_1", :struct, OpenapiPetstore.Model.Map, options) + |> deserialize(:"anytype_2", :struct, OpenapiPetstore.Model.Map, options) + |> deserialize(:"anytype_3", :struct, OpenapiPetstore.Model.Map, options) end 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 new file mode 100644 index 00000000000..06144a65df4 --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_integer.ex @@ -0,0 +1,25 @@ +# 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/open_api_petstore/model/category.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_number.ex similarity index 65% rename from samples/client/petstore/elixir/lib/open_api_petstore/model/category.ex rename to samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_number.ex index eab3b7fca3f..646b8bef38b 100644 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/category.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_number.ex @@ -2,24 +2,22 @@ # https://openapi-generator.tech # Do not edit the class manually. -defmodule OpenAPIPetstore.Model.Category do +defmodule OpenapiPetstore.Model.AdditionalPropertiesNumber do @moduledoc """ """ @derive [Poison.Encoder] defstruct [ - :"id", :"name" ] @type t :: %__MODULE__{ - :"id" => integer() | nil, - :"name" => String.t + :"name" => String.t | nil } end -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Category do +defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesNumber do def decode(value, _options) do value end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_number_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_object.ex similarity index 63% rename from samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_number_only.ex rename to samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_object.ex index 1ed4bab441a..be9b2d866c3 100644 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/array_of_number_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_object.ex @@ -2,22 +2,22 @@ # https://openapi-generator.tech # Do not edit the class manually. -defmodule OpenAPIPetstore.Model.ArrayOfNumberOnly do +defmodule OpenapiPetstore.Model.AdditionalPropertiesObject do @moduledoc """ """ @derive [Poison.Encoder] defstruct [ - :"ArrayNumber" + :"name" ] @type t :: %__MODULE__{ - :"ArrayNumber" => [float()] | nil + :"name" => String.t | nil } end -defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ArrayOfNumberOnly do +defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesObject do def decode(value, _options) do value end diff --git a/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_string.ex similarity index 63% rename from samples/client/petstore/elixir/lib/open_api_petstore/model/enum_class.ex rename to samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_string.ex index 9f6f366cc68..9a53ba07ab3 100644 --- a/samples/client/petstore/elixir/lib/open_api_petstore/model/enum_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_string.ex @@ -2,22 +2,22 @@ # https://openapi-generator.tech # Do not edit the class manually. -defmodule OpenAPIPetstore.Model.EnumClass do +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.EnumClass do +defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesString do def decode(value, _options) do value end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/animal_farm.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/animal_farm.ex deleted file mode 100644 index faf804798b5..00000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/animal_farm.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.AnimalFarm do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - - ] - - @type t :: %__MODULE__{ - - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.AnimalFarm do - def decode(value, _options) do - value - end -end - diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/string_boolean_map.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/string_boolean_map.ex deleted file mode 100644 index 68c76b6fe59..00000000000 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/string_boolean_map.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.StringBooleanMap do - @moduledoc """ - - """ - - @derive [Poison.Encoder] - defstruct [ - - ] - - @type t :: %__MODULE__{ - - } -end - -defimpl Poison.Decoder, for: OpenapiPetstore.Model.StringBooleanMap 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 178e3fde04a..a37e01a8de6 100644 --- a/samples/client/petstore/elixir/mix.exs +++ b/samples/client/petstore/elixir/mix.exs @@ -1,10 +1,10 @@ -defmodule OpenAPIPetstore.Mixfile do +defmodule OpenapiPetstore.Mixfile do use Mix.Project def project do - [app: :open_api_petstore, - version: "0.1.0", - elixir: "~> 1.4", + [app: :openapi_petstore, + version: "1.0.0", + elixir: "~> 1.6", build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, deps: deps()] @@ -24,13 +24,13 @@ defmodule OpenAPIPetstore.Mixfile do # # Or git/path repositories: # - # {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} + # {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.3.0"} # # Type "mix help deps" for more examples and options defp deps do [ - {:tesla, "~> 1.0.0"}, - {:poison, "~> 3.0.0"} + {:tesla, "~> 1.2"}, + {:poison, "~> 3.0"} ] end end diff --git a/samples/client/petstore/elixir/pom.xml b/samples/client/petstore/elixir/pom.xml index 8ea376a48db..589db62d2dc 100644 --- a/samples/client/petstore/elixir/pom.xml +++ b/samples/client/petstore/elixir/pom.xml @@ -55,6 +55,19 @@ + + 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 new file mode 100644 index 00000000000..6011a08ccf5 --- /dev/null +++ b/samples/client/petstore/elixir/test/pet_test.exs @@ -0,0 +1,60 @@ +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 diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 28eeab29ad3..3737c0014e4 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -32,6 +32,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 405: content: {} description: Invalid input @@ -56,6 +59,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid ID supplied @@ -174,6 +180,9 @@ paths: format: int64 type: integer responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid pet value diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 28eeab29ad3..3737c0014e4 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -32,6 +32,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 405: content: {} description: Invalid input @@ -56,6 +59,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid ID supplied @@ -174,6 +180,9 @@ paths: format: int64 type: integer responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid pet value diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java index ef2c90a14a3..1dacd5912b5 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java @@ -44,6 +44,7 @@ public class PetApi { /** * Add a new pet to the store + *

200 - successful operation *

405 - Invalid input * @param body Pet object that needs to be added to the store * @throws IOException if an error occurs while attempting to invoke the API @@ -54,6 +55,7 @@ public class PetApi { /** * Add a new pet to the store + *

200 - successful operation *

405 - Invalid input * @param body Pet object that needs to be added to the store * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. @@ -128,6 +130,7 @@ public class PetApi { /** * Deletes a pet + *

200 - successful operation *

400 - Invalid pet value * @param petId Pet id to delete * @param apiKey The apiKey parameter @@ -139,6 +142,7 @@ public class PetApi { /** * Deletes a pet + *

200 - successful operation *

400 - Invalid pet value * @param petId Pet id to delete * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. @@ -471,6 +475,7 @@ public class PetApi { /** * Update an existing pet + *

200 - successful operation *

400 - Invalid ID supplied *

404 - Pet not found *

405 - Validation exception @@ -483,6 +488,7 @@ public class PetApi { /** * Update an existing pet + *

200 - successful operation *

400 - Invalid ID supplied *

404 - Pet not found *

405 - Validation exception diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java index 0286725dc3c..3a50006b724 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java @@ -57,6 +57,7 @@ public class PetApi { nickname = "addPet", tags = { "pet" }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") , @ApiResponse(code = 405, message = "Invalid input") }) public AddPetOper addPet() { return new AddPetOper(reqSpec); @@ -67,6 +68,7 @@ public class PetApi { nickname = "deletePet", tags = { "pet" }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") , @ApiResponse(code = 400, message = "Invalid pet value") }) public DeletePetOper deletePet() { return new DeletePetOper(reqSpec); @@ -112,6 +114,7 @@ public class PetApi { nickname = "updatePet", tags = { "pet" }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") , @ApiResponse(code = 400, message = "Invalid ID supplied") , @ApiResponse(code = 404, message = "Pet not found") , @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java index 2845d3dc08a..4adb3a4e2a4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java @@ -51,6 +51,7 @@ public class PetApi { /** * Add a new pet to the store * + *

200 - successful operation *

405 - Invalid input * @param body Pet object that needs to be added to the store * @throws RestClientException if an error occurs while attempting to invoke the API @@ -84,6 +85,7 @@ public class PetApi { /** * Deletes a pet * + *

200 - successful operation *

400 - Invalid pet value * @param petId Pet id to delete * @param apiKey The apiKey parameter @@ -235,6 +237,7 @@ public class PetApi { /** * Update an existing pet * + *

200 - successful operation *

400 - Invalid ID supplied *

404 - Pet not found *

405 - Validation exception diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java index 2845d3dc08a..4adb3a4e2a4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java @@ -51,6 +51,7 @@ public class PetApi { /** * Add a new pet to the store * + *

200 - successful operation *

405 - Invalid input * @param body Pet object that needs to be added to the store * @throws RestClientException if an error occurs while attempting to invoke the API @@ -84,6 +85,7 @@ public class PetApi { /** * Deletes a pet * + *

200 - successful operation *

400 - Invalid pet value * @param petId Pet id to delete * @param apiKey The apiKey parameter @@ -235,6 +237,7 @@ public class PetApi { /** * Update an existing pet * + *

200 - successful operation *

400 - Invalid ID supplied *

404 - Pet not found *

405 - Validation exception diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java index 89c82456e76..24140bcb0c8 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -50,6 +50,7 @@ public class PetApi { /** * Add a new pet to the store * + *

200 - successful operation *

405 - Invalid input * @param body Pet object that needs to be added to the store * @throws RestClientException if an error occurs while attempting to invoke the API @@ -83,6 +84,7 @@ public class PetApi { /** * Deletes a pet * + *

200 - successful operation *

400 - Invalid pet value * @param petId Pet id to delete * @param apiKey The apiKey parameter @@ -234,6 +236,7 @@ public class PetApi { /** * Update an existing pet * + *

200 - successful operation *

400 - Invalid ID supplied *

404 - Pet not found *

405 - Validation exception diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApi.java index 215eedde5ea..2eda2bdbdfb 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApi.java @@ -43,6 +43,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body ) @@ -60,6 +62,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId ,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey @@ -134,6 +138,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/PetApi.java index 6d593eaaf51..0499feff7e9 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/PetApi.java @@ -43,6 +43,7 @@ public interface PetApi { @Consumes({ "application/json", "application/xml" }) @ApiOperation(value = "Add a new pet to the store", tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) public void addPet(@Valid Pet body); @@ -54,6 +55,7 @@ public interface PetApi { @Path("/pet/{petId}") @ApiOperation(value = "Deletes a pet", tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); @@ -112,6 +114,7 @@ public interface PetApi { @Consumes({ "application/json", "application/xml" }) @ApiOperation(value = "Update an existing pet", tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java index a1dc27a9c5a..7c9b45495e0 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java @@ -40,6 +40,7 @@ public interface PetApi { @Consumes({ "application/json", "application/xml" }) @ApiOperation(value = "Add a new pet to the store", tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) public void addPet(@Valid Pet body); @@ -51,6 +52,7 @@ public interface PetApi { @Path("/pet/{petId}") @ApiOperation(value = "Deletes a pet", tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); @@ -109,6 +111,7 @@ public interface PetApi { @Consumes({ "application/json", "application/xml" }) @ApiOperation(value = "Update an existing pet", tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java index 1853435c51d..d0dbb1a8369 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java @@ -68,6 +68,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet body ,@Context SecurityContext securityContext) @@ -85,6 +87,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId ,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey @@ -159,6 +163,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java index 8f1d606ae11..4943b5c22f8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java @@ -28,6 +28,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) void addPet(@Valid Pet body); @@ -40,6 +41,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); @@ -92,6 +94,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index 9e0ccd2c0cd..2f1d9998fcd 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -32,6 +32,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 405: content: {} description: Invalid input @@ -58,6 +61,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid ID supplied @@ -182,6 +188,9 @@ paths: format: int64 type: integer responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid pet value diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java index 76d567dba8b..e32b2f496ec 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java @@ -28,6 +28,7 @@ public class PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet(@Valid Pet body) { @@ -43,6 +44,7 @@ public class PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) { @@ -107,6 +109,7 @@ public class PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 9e0ccd2c0cd..2f1d9998fcd 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -32,6 +32,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 405: content: {} description: Invalid input @@ -58,6 +61,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid ID supplied @@ -182,6 +188,9 @@ paths: format: int64 type: integer responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid pet value diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java index 4edb7ecf69f..9808128eee9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java @@ -46,6 +46,7 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet( @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet body, @@ -64,6 +65,7 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet( @ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, @@ -138,6 +140,7 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java index b8dd3905e8f..c356a525d94 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java @@ -46,6 +46,7 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet( @ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet body, @@ -64,6 +65,7 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet( @ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId, @@ -138,6 +140,7 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java index 0c4a06ba49d..81fb7e7cbdd 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java @@ -68,6 +68,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet body ,@Context SecurityContext securityContext) @@ -85,6 +87,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId ,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey @@ -159,6 +163,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java index a2fcda70d3d..f3336eda6d6 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java @@ -68,6 +68,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet body ,@Context SecurityContext securityContext) @@ -85,6 +87,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId ,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey @@ -159,6 +163,8 @@ public class PetApi { }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index 28d429dae6b..baa54215e88 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -45,6 +45,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, @@ -62,6 +63,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) @@ -172,6 +174,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index 129a22c3ea1..a1ff63f3b90 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -44,6 +44,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, @@ -61,6 +62,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) @@ -165,6 +167,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index ca2f0ec8055..8d0d793fee6 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -36,6 +36,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, @@ -50,6 +51,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) @@ -106,6 +108,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index ca2f0ec8055..8d0d793fee6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -36,6 +36,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, @@ -50,6 +51,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) @@ -106,6 +108,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 883a6ab40b8..a77b65ec09b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -40,6 +40,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, @@ -56,6 +57,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) @@ -120,6 +122,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index ca2f0ec8055..8d0d793fee6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -36,6 +36,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, @@ -50,6 +51,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) @@ -106,6 +108,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 42e1e1f1014..18ee4397eb1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -44,6 +44,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @ApiImplicitParams({ }) @@ -63,6 +64,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @ApiImplicitParams({ @ApiImplicitParam(name = "apiKey", value = "", dataType = "String", paramType = "header") @@ -176,6 +178,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index ad21ca56294..e6a12f25a26 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -43,6 +43,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, @@ -59,6 +60,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) @@ -123,6 +125,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index f6db43616ae..78273bb6147 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -32,6 +32,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 405: content: {} description: Invalid input @@ -60,6 +63,9 @@ paths: description: Pet object that needs to be added to the store required: true responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid ID supplied @@ -188,6 +194,9 @@ paths: format: int64 type: integer responses: + 200: + content: {} + description: successful operation 400: content: {} description: Invalid pet value diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index a5614d7ac50..99f01b77785 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -44,6 +44,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, @@ -61,6 +62,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) @@ -165,6 +167,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 066f3be992e..36e659cd461 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -48,6 +48,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, @@ -66,6 +67,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) @@ -174,6 +176,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") }) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 129a22c3ea1..a1ff63f3b90 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -44,6 +44,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 405, message = "Invalid input") }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, @@ -61,6 +62,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid pet value") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) @@ -165,6 +167,7 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation"), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 405, message = "Validation exception") })