From 7e5f720f204a992d0355239bf2e155940258f809 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sun, 31 May 2020 07:14:31 -0400 Subject: [PATCH 01/12] Remove deprecations 5.0 (#6060) * [breaking] Enforce vendor extension naming convention * [breaking] Rename system properties to global properties * [docs] Update site with global properties list and usage explanation * Use proper vendor extension casing in all templates * Set remaining vendor extensions to convention of lower kebab-cased with x- prefix * [samples] Regenerate * Update modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java Before we were adding hasPathParams twice, once with !op.pathParams.isEmpty(), and then again with hasPathParams. This was probably caused by a mistaken merge. This is causing the difference in samples Co-authored-by: Richard Whitehouse * [Samples] Regenerated! * Fix -D conversion to additional-properties, missed in bat files * JERSEY2 option changed * [samples] Regenerate * [scala][finch] Fix remaining vendor extensions format to conventino * [scala] The -D option was replaced with --global-property * [samples] Regenerate * Fix -DskipFormModel usage which has been moved to --global-property skipFormModel=true * [samples] Regenerate Co-authored-by: Richard Whitehouse --- bin/apex-petstore.sh | 2 +- bin/ruby-client-petstore-faraday.sh | 2 +- bin/ruby-client-petstore.sh | 2 +- bin/scala-finch-petstore-server.sh | 2 +- bin/scala-lagom-server-petstore.sh | 2 +- bin/scalaz-petstore.sh | 2 +- bin/windows/android-petstore-httpclient.bat | 2 +- bin/windows/go-experimental-petstore.bat | 2 +- docs/customization.md | 11 +- docs/global-properties.md | 43 ++ docs/usage.md | 25 +- .../openapitools/codegen/cmd/Generate.java | 3 +- .../codegen/config/WorkflowSettings.java | 48 +- .../codegen/config/WorkflowSettingsTest.java | 8 +- .../README.adoc | 12 +- .../samples/local-spec/build.gradle | 4 +- .../gradle/plugin/OpenApiGeneratorPlugin.kt | 2 +- .../OpenApiGeneratorGenerateExtension.kt | 4 +- .../gradle/plugin/tasks/GenerateTask.kt | 17 +- .../codegen/plugin/CodeGenMojo.java | 22 +- .../codegen/config/CodegenConfigurator.java | 21 +- .../config/CodegenConfiguratorUtils.java | 35 +- .../languages/AbstractApexCodegen.java | 7 - .../languages/AbstractCSharpCodegen.java | 3 - .../languages/AbstractEiffelCodegen.java | 5 - .../codegen/languages/AbstractGoCodegen.java | 13 - .../languages/AbstractJavaCodegen.java | 5 - .../codegen/languages/AbstractPhpCodegen.java | 5 - .../languages/Apache2ConfigCodegen.java | 5 - .../languages/ClojureClientCodegen.java | 7 - .../languages/CppPistacheServerCodegen.java | 7 - .../languages/CppRestbedServerCodegen.java | 5 - .../languages/DartDioClientCodegen.java | 11 - .../languages/DartJaguarClientCodegen.java | 12 - .../languages/HaskellHttpClientCodegen.java | 81 +-- .../languages/HaskellServantCodegen.java | 12 - .../codegen/languages/JavaClientCodegen.java | 10 +- .../languages/JavaPlayFrameworkCodegen.java | 5 - .../JavascriptApolloClientCodegen.java | 18 - .../languages/JavascriptClientCodegen.java | 18 - .../codegen/languages/MysqlSchemaCodegen.java | 68 +-- .../codegen/languages/OCamlClientCodegen.java | 6 +- .../codegen/languages/ObjcClientCodegen.java | 9 - .../languages/PhpSymfonyServerCodegen.java | 17 - ...endExpressivePathHandlerServerCodegen.java | 1 + .../codegen/languages/RustClientCodegen.java | 5 - .../codegen/languages/RustServerCodegen.java | 84 +-- .../languages/ScalaFinchServerCodegen.java | 30 +- .../ScalaPlayFrameworkServerCodegen.java | 9 - .../languages/StaticHtml2Generator.java | 9 - .../TypeScriptRxjsClientCodegen.java | 4 - .../utils/OneOfImplementorAdditionalData.java | 11 +- .../main/resources/apex/model_test.mustache | 16 +- .../src/main/resources/apex/pojo.mustache | 12 +- .../main/resources/dart-jaguar/api.mustache | 4 +- .../main/resources/dart-jaguar/class.mustache | 4 +- .../haskell-http-client/MimeTypes.mustache | 4 +- .../haskell-http-client/Model.mustache | 34 +- .../tests/Instances.mustache | 2 +- .../mysql-schema/mysql_schema.mustache | 14 +- .../resources/mysql-schema/sql_query.mustache | 16 +- .../src/main/resources/ocaml/of_json.mustache | 2 +- .../src/main/resources/ocaml/to_json.mustache | 2 +- .../main/resources/ocaml/to_string.mustache | 2 +- .../resources/rust-server/README.mustache | 4 +- .../rust-server/client-callbacks.mustache | 2 +- .../rust-server/client-operation.mustache | 72 +-- .../rust-server/example-client-main.mustache | 16 +- .../example-server-operation.mustache | 8 +- .../main/resources/rust-server/lib.mustache | 32 +- .../resources/rust-server/models.mustache | 22 +- .../resources/rust-server/response.mustache | 22 +- .../rust-server/server-operation.mustache | 106 ++-- .../src/main/resources/rust/model.mustache | 4 +- .../codegen/AbstractIntegrationTest.java | 4 +- .../config/CodegenConfiguratorTest.java | 3 +- .../OneOfImplementorAdditionalDataTest.java | 2 +- .../src/test/resources/sampleConfig.json | 2 +- .../lib/OpenAPIPetstore/Model.hs | 6 +- .../ruby-faraday/.openapi-generator/FILES | 18 - .../client/petstore/ruby-faraday/README.md | 6 - .../ruby-faraday/docs/InlineObject.md | 19 - .../ruby-faraday/docs/InlineObject1.md | 19 - .../ruby-faraday/docs/InlineObject2.md | 19 - .../ruby-faraday/docs/InlineObject3.md | 43 -- .../ruby-faraday/docs/InlineObject4.md | 19 - .../ruby-faraday/docs/InlineObject5.md | 19 - .../petstore/ruby-faraday/lib/petstore.rb | 6 - .../lib/petstore/models/inline_object.rb | 217 ------- .../lib/petstore/models/inline_object1.rb | 217 ------- .../lib/petstore/models/inline_object2.rb | 255 --------- .../lib/petstore/models/inline_object3.rb | 538 ------------------ .../lib/petstore/models/inline_object4.rb | 227 -------- .../lib/petstore/models/inline_object5.rb | 222 -------- .../spec/models/inline_object1_spec.rb | 47 -- .../spec/models/inline_object2_spec.rb | 55 -- .../spec/models/inline_object3_spec.rb | 119 ---- .../spec/models/inline_object4_spec.rb | 47 -- .../spec/models/inline_object5_spec.rb | 47 -- .../spec/models/inline_object_spec.rb | 47 -- .../petstore/ruby/.openapi-generator/FILES | 18 - samples/client/petstore/ruby/README.md | 6 - .../client/petstore/ruby/docs/InlineObject.md | 19 - .../petstore/ruby/docs/InlineObject1.md | 19 - .../petstore/ruby/docs/InlineObject2.md | 19 - .../petstore/ruby/docs/InlineObject3.md | 43 -- .../petstore/ruby/docs/InlineObject4.md | 19 - .../petstore/ruby/docs/InlineObject5.md | 19 - samples/client/petstore/ruby/lib/petstore.rb | 6 - .../ruby/lib/petstore/models/inline_object.rb | 217 ------- .../lib/petstore/models/inline_object1.rb | 217 ------- .../lib/petstore/models/inline_object2.rb | 255 --------- .../lib/petstore/models/inline_object3.rb | 538 ------------------ .../lib/petstore/models/inline_object4.rb | 227 -------- .../lib/petstore/models/inline_object5.rb | 222 -------- .../ruby/spec/models/inline_object1_spec.rb | 47 -- .../ruby/spec/models/inline_object2_spec.rb | 55 -- .../ruby/spec/models/inline_object3_spec.rb | 119 ---- .../ruby/spec/models/inline_object4_spec.rb | 47 -- .../ruby/spec/models/inline_object5_spec.rb | 47 -- .../ruby/spec/models/inline_object_spec.rb | 47 -- .../.openapi-generator/VERSION | 2 +- website/docusaurus.config.js | 2 +- website/sidebars.js | 3 +- 124 files changed, 404 insertions(+), 5185 deletions(-) create mode 100644 docs/global-properties.md delete mode 100644 samples/client/petstore/ruby-faraday/docs/InlineObject.md delete mode 100644 samples/client/petstore/ruby-faraday/docs/InlineObject1.md delete mode 100644 samples/client/petstore/ruby-faraday/docs/InlineObject2.md delete mode 100644 samples/client/petstore/ruby-faraday/docs/InlineObject3.md delete mode 100644 samples/client/petstore/ruby-faraday/docs/InlineObject4.md delete mode 100644 samples/client/petstore/ruby-faraday/docs/InlineObject5.md delete mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb delete mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb delete mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb delete mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb delete mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb delete mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb delete mode 100644 samples/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb delete mode 100644 samples/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb delete mode 100644 samples/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb delete mode 100644 samples/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb delete mode 100644 samples/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb delete mode 100644 samples/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb delete mode 100644 samples/client/petstore/ruby/docs/InlineObject.md delete mode 100644 samples/client/petstore/ruby/docs/InlineObject1.md delete mode 100644 samples/client/petstore/ruby/docs/InlineObject2.md delete mode 100644 samples/client/petstore/ruby/docs/InlineObject3.md delete mode 100644 samples/client/petstore/ruby/docs/InlineObject4.md delete mode 100644 samples/client/petstore/ruby/docs/InlineObject5.md delete mode 100644 samples/client/petstore/ruby/lib/petstore/models/inline_object.rb delete mode 100644 samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb delete mode 100644 samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb delete mode 100644 samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb delete mode 100644 samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb delete mode 100644 samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb delete mode 100644 samples/client/petstore/ruby/spec/models/inline_object1_spec.rb delete mode 100644 samples/client/petstore/ruby/spec/models/inline_object2_spec.rb delete mode 100644 samples/client/petstore/ruby/spec/models/inline_object3_spec.rb delete mode 100644 samples/client/petstore/ruby/spec/models/inline_object4_spec.rb delete mode 100644 samples/client/petstore/ruby/spec/models/inline_object5_spec.rb delete mode 100644 samples/client/petstore/ruby/spec/models/inline_object_spec.rb diff --git a/bin/apex-petstore.sh b/bin/apex-petstore.sh index 28863b97d247..bdafe9e58252 100755 --- a/bin/apex-petstore.sh +++ b/bin/apex-petstore.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/apex -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g apex -o samples/client/petstore/apex -DskipFormModel=true $@" +ags="generate -t modules/openapi-generator/src/main/resources/apex -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g apex -o samples/client/petstore/apex --global-property skipFormModel=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-client-petstore-faraday.sh b/bin/ruby-client-petstore-faraday.sh index 3a8afdd28d11..502cc689fe3c 100755 --- a/bin/ruby-client-petstore-faraday.sh +++ b/bin/ruby-client-petstore-faraday.sh @@ -38,6 +38,6 @@ find samples/client/petstore/ruby-faraday/spec -type f -not -name petstore_helpe # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore-faraday.json -o samples/client/petstore/ruby-faraday --additional-properties skipFormModel=true $@" +ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore-faraday.json -o samples/client/petstore/ruby-faraday --global-property skipFormModel=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-client-petstore.sh b/bin/ruby-client-petstore.sh index 292d70a443a0..8a92eb8f1ac0 100755 --- a/bin/ruby-client-petstore.sh +++ b/bin/ruby-client-petstore.sh @@ -38,6 +38,6 @@ find samples/client/petstore/ruby/spec -type f -not -name petstore_helper.rb -no # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby --additional-properties skipFormModel=true $@" +ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby --global-property skipFormModel=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scala-finch-petstore-server.sh b/bin/scala-finch-petstore-server.sh index 080d338ae7f3..08fd0ae1e7d5 100755 --- a/bin/scala-finch-petstore-server.sh +++ b/bin/scala-finch-petstore-server.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/scala-finch -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-finch -o samples/server/petstore/scala-finch -DskipFormModel=true $@" +ags="generate -t modules/openapi-generator/src/main/resources/scala-finch -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-finch -o samples/server/petstore/scala-finch --global-property skipFormModel=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scala-lagom-server-petstore.sh b/bin/scala-lagom-server-petstore.sh index ab3720b618e8..ff9ab8ce7177 100755 --- a/bin/scala-lagom-server-petstore.sh +++ b/bin/scala-lagom-server-petstore.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/scala-lagom-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-lagom-server -o samples/server/petstore/scala-lagom-server -DskipFormModel=true $@" +ags="generate -t modules/openapi-generator/src/main/resources/scala-lagom-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-lagom-server -o samples/server/petstore/scala-lagom-server --global-property skipFormModel=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scalaz-petstore.sh b/bin/scalaz-petstore.sh index ff35e33a52b3..dca1f9544f5a 100755 --- a/bin/scalaz-petstore.sh +++ b/bin/scalaz-petstore.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/scalaz -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scalaz -o samples/client/petstore/scalaz -DskipFormModel=true $@" +ags="generate -t modules/openapi-generator/src/main/resources/scalaz -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scalaz -o samples/client/petstore/scalaz --global-property skipFormModel=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/android-petstore-httpclient.bat b/bin/windows/android-petstore-httpclient.bat index 181ec906a493..602d885e90ea 100755 --- a/bin/windows/android-petstore-httpclient.bat +++ b/bin/windows/android-petstore-httpclient.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g android -o samples\client\petstore\android\httpclient -Dlibrary=httpclient +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g android -o samples\client\petstore\android\httpclient --additional-properties library=httpclient java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/go-experimental-petstore.bat b/bin/windows/go-experimental-petstore.bat index 1a62e273e5d4..d4c7d1c23a5c 100755 --- a/bin/windows/go-experimental-petstore.bat +++ b/bin/windows/go-experimental-petstore.bat @@ -14,7 +14,7 @@ echo Removing files and folders under %STUB_DIR% del /F /S /Q %STUB_DIR% REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -t modules\openapi-generator\src\main\resources\%GENERATOR% -i %SPEC% -g %GENERATOR% -o %STUB_DIR% -DpackageName=petstore +set ags=generate -t modules\openapi-generator\src\main\resources\%GENERATOR% -i %SPEC% -g %GENERATOR% -o %STUB_DIR% --additional-properties packageName=petstore java %JAVA_OPTS% -jar %executable% %ags% diff --git a/docs/customization.md b/docs/customization.md index fbdc5a890cdb..fe40349f31e1 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -90,7 +90,8 @@ You can use this as additional dependency of the `openapi-generator-maven-plugin If you publish your artifact to a distant maven repository, do not forget to add this repository as `pluginRepository` for your project. ## Selective generation -You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output: + +You may not want to generate *all* models in your project. Likewise, you may want just one or two apis to be written. If that's the case, you can use system properties or [global properties](./global-properties.md) to control the output. The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated: @@ -142,7 +143,13 @@ When using selective generation, _only_ the templates needed for the specific ge To skip models defined as the form parameters in "requestBody", please use `skipFormModel` (default to false) (this option is introduced at v3.2.2) ```sh -java -DskipFormModel=true +java -DskipFormModel=true generate … +``` + +or + +```sh +java generate --global-property skipFormModel=true … ``` This option will be helpful to skip model generation due to the form parameter, which is defined differently in OAS3 as there's no form parameter in OAS3 diff --git a/docs/global-properties.md b/docs/global-properties.md new file mode 100644 index 000000000000..c2c0aab64788 --- /dev/null +++ b/docs/global-properties.md @@ -0,0 +1,43 @@ +--- +id: globals +title: Global Properties +--- + +## Available Global Properties + +| Property | Description | Acceptable value | +| -------- | ------------| ---------------- | +| debugOpenAPI | Dumps JSON formatted and fully parsed OpenAPI document during generation | none | +| debugModels | Dumps JSON formatted template-bound model information during generation | none | +| debugOperations | Dumps JSON formatted template-bound operation information during generation | none | +| debugSupportingFiles | Dumps JSON formatted Supporting File information during generation | none | +| verbose | Defines the verbosity | `true` or `false` | +| generateAliasAsModel | Defines whether primitive types defined at the model/schema level will be wrapped in a model | `true` or `false` | +| org.openapitools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs | `true` or `false` | +| supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of file names | +| models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of model names | +| apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of api names | +| apiDocs | Allows the user to define if api docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | +| modelDocs | Allows the user to define if model docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | +| apiTests | Allows the user to define if api tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | +| modelTests | Allows the user to define if model tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | +| withXml | Allows the user to control support of XML generated constructs, where supported | none | + + +## Note on Global Property declaration + +There are _two ways_ to provide selective generation properties or "global properties". First, these can be passed as Java System Properties. Second, these can be passed via the global property tooling option (`--global-property` in CLI and `globalProperty` in Maven and Gradle configurations). This differentiation is new in version 5.0 with the removal of the `-D` CLI option and the renaming of `systemProperties`. If you're upgrading to OpenAPI Generator 5.0+ + +While the examples seen in [Customization](./customization.md) use the Java System Property syntax, keep in mind that the following are equivalent: + +```sh +java -Dmodels {jar} generate {opts} +``` + +and + +```sh +java {jar} generate {opts} --global-property=models +``` + +Why the two differing ways to provide the same properties? We previously accepted a `-D` tooling option which resembled Java System Property declaration. In older versions of OpenAPI Generator, the option modified the SystemProperties collection directly and was truly a "system property". This option changed during the 4.x release in an effort to make OpenAPI Generator thread-safe and isolate its configuration via thread locals. We no longer mutate System Properties. In the 4.x release and earlier, specifying the tooling `-D` option with system properties intended for other tools like swagger-parser rather than passing them as true Java System Properties would lead to unexpected behavior for the user; if our tool set the system property _after_ invoking certain code, it would seem to the user like Java System Properties weren't working! \ No newline at end of file diff --git a/docs/usage.md b/docs/usage.md index 4522d5510091..68e022e5fbf3 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -261,14 +261,14 @@ SYNOPSIS [(-a | --auth )] [--api-name-suffix ] [--api-package ] [--artifact-id ] [--artifact-version ] - [(-c | --config )] - [-D ...] [--dry-run] + [(-c | --config )] [--dry-run] [(-e | --engine )] [--enable-post-process-file] [(-g | --generator-name )] [--generate-alias-as-model] [--git-host ] [--git-repo-id ] [--git-user-id ] - [--group-id ] [--http-user-agent ] + [--global-property ...] [--group-id ] + [--http-user-agent ] (-i | --input-spec ) [--ignore-file-override ] [--import-mappings ...] @@ -324,10 +324,6 @@ OPTIONS different for each language. Run config-help -g {generator name} command for language-specific config options. - -D - sets specified system properties in the format of - name=value,name=value (or multiple options, each with name=value) - --dry-run Try things out and report on potential changes (without actually making changes). @@ -343,11 +339,11 @@ OPTIONS --generate-alias-as-model Generate model implementation for aliases to map and array schemas. - An 'alias' is an array, map, or list which is defined inline in a - OpenAPI document and becomes a model in the generated code. - A 'map' schema is an object that can have undeclared properties, - i.e. the 'additionalproperties' attribute is set on that object. - An 'array' schema is a list of sub schemas in a OAS document. + An 'alias' is an array, map, or list which is defined inline in a + OpenAPI document and becomes a model in the generated code. A 'map' + schema is an object that can have undeclared properties, i.e. the + 'additionalproperties' attribute is set on that object. An 'array' + schema is a list of sub schemas in a OAS document --git-host Git host, e.g. gitlab.com. @@ -358,6 +354,11 @@ OPTIONS --git-user-id Git user ID, e.g. openapitools. + --global-property + sets specified global properties (previously called 'system + properties') in the format of name=value,name=value (or multiple + options, each with name=value) + --group-id groupId in generated pom.xml diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java index 084026f5552e..b7f989eeaacd 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java @@ -71,9 +71,8 @@ public class Generate extends OpenApiGeneratorCommand { + "Pass in a URL-encoded string of name:header with a comma separating multiple values") private String auth; - // TODO: Remove -D short option in 5.0 @Option( - name = {"-D", "--global-property"}, + name = {"--global-property"}, title = "global properties", description = "sets specified global properties (previously called 'system properties') in " + "the format of name=value,name=value (or multiple options, each with name=value)") diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java index 2a0c9ac572af..c7a49db52a73 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java @@ -47,7 +47,7 @@ public class WorkflowSettings { public static final boolean DEFAULT_ENABLE_MINIMAL_UPDATE = false; public static final boolean DEFAULT_STRICT_SPEC_BEHAVIOR = true; public static final String DEFAULT_TEMPLATING_ENGINE_NAME = "mustache"; - public static final ImmutableMap DEFAULT_SYSTEM_PROPERTIES = ImmutableMap.of(); + public static final ImmutableMap DEFAULT_GLOBAL_PROPERTIES = ImmutableMap.of(); private String inputSpec; private String outputDir = DEFAULT_OUTPUT_DIR; @@ -62,7 +62,7 @@ public class WorkflowSettings { private String templateDir; private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME; private String ignoreFileOverride; - private ImmutableMap systemProperties = DEFAULT_SYSTEM_PROPERTIES; + private ImmutableMap globalProperties = DEFAULT_GLOBAL_PROPERTIES; private WorkflowSettings(Builder builder) { this.inputSpec = builder.inputSpec; @@ -78,15 +78,7 @@ private WorkflowSettings(Builder builder) { this.templateDir = builder.templateDir; this.templatingEngineName = builder.templatingEngineName; this.ignoreFileOverride = builder.ignoreFileOverride; - // TODO: rename to globalProperties for 5.0 - this.systemProperties = ImmutableMap.copyOf(builder.systemProperties); - if (this.systemProperties.size() > 0) { - // write no more than every 5s. This is temporary until version 5.0 as once(Logger) is not accessible here. - // thread contention may cause this to write more than once, but this is just an attempt to reduce noise - if (System.currentTimeMillis() - lastWarning.getAndUpdate(x -> System.currentTimeMillis()) > 5000) { - LOGGER.warn("systemProperties will be renamed to globalProperties in version 5.0"); - } - } + this.globalProperties = ImmutableMap.copyOf(builder.globalProperties); } /** @@ -117,7 +109,7 @@ public static Builder newBuilder(WorkflowSettings copy) { builder.ignoreFileOverride = copy.getIgnoreFileOverride(); // this, and any other collections, must be mutable in the builder. - builder.systemProperties = new HashMap<>(copy.getSystemProperties()); + builder.globalProperties = new HashMap<>(copy.getGlobalProperties()); // force builder "with" methods to invoke side effects builder.withTemplateDir(copy.getTemplateDir()); @@ -264,8 +256,8 @@ public String getIgnoreFileOverride() { * * @return the system properties */ - public Map getSystemProperties() { - return systemProperties; + public Map getGlobalProperties() { + return globalProperties; } /** @@ -288,7 +280,7 @@ public static final class Builder { private String ignoreFileOverride; // NOTE: All collections must be mutable in the builder, and copied to a new immutable collection in .build() - private Map systemProperties = new HashMap<>();; + private Map globalProperties = new HashMap<>();; private Builder() { } @@ -469,30 +461,30 @@ public Builder withIgnoreFileOverride(String ignoreFileOverride) { } /** - * Sets the {@code systemProperties} and returns a reference to this Builder so that the methods can be chained together. + * Sets the {@code globalProperties} and returns a reference to this Builder so that the methods can be chained together. * - * @param systemProperties the {@code systemProperties} to set + * @param globalProperties the {@code globalProperties} to set * @return a reference to this Builder */ - public Builder withSystemProperties(Map systemProperties) { - if (systemProperties != null) { - this.systemProperties = systemProperties; + public Builder withGlobalProperties(Map globalProperties) { + if (globalProperties != null) { + this.globalProperties = globalProperties; } return this; } /** - * Sets the {@code systemProperties} and returns a reference to this Builder so that the methods can be chained together. + * Sets the {@code globalProperties} and returns a reference to this Builder so that the methods can be chained together. * * @param key The key of a system (global) property to set * @param value The value of a system (global) property to set * @return a reference to this Builder */ - public Builder withSystemProperty(String key, String value) { - if (this.systemProperties == null) { - this.systemProperties = new HashMap<>(); + public Builder withGlobalProperty(String key, String value) { + if (this.globalProperties == null) { + this.globalProperties = new HashMap<>(); } - this.systemProperties.put(key, value); + this.globalProperties.put(key, value); return this; } @@ -526,7 +518,7 @@ public String toString() { ", templateDir='" + templateDir + '\'' + ", templatingEngineName='" + templatingEngineName + '\'' + ", ignoreFileOverride='" + ignoreFileOverride + '\'' + - ", systemProperties=" + systemProperties + + ", globalProperties=" + globalProperties + '}'; } @@ -548,7 +540,7 @@ public boolean equals(Object o) { Objects.equals(getTemplateDir(), that.getTemplateDir()) && Objects.equals(getTemplatingEngineName(), that.getTemplatingEngineName()) && Objects.equals(getIgnoreFileOverride(), that.getIgnoreFileOverride()) && - Objects.equals(getSystemProperties(), that.getSystemProperties()); + Objects.equals(getGlobalProperties(), that.getGlobalProperties()); } @Override @@ -567,7 +559,7 @@ public int hashCode() { getTemplateDir(), getTemplatingEngineName(), getIgnoreFileOverride(), - getSystemProperties() + getGlobalProperties() ); } } diff --git a/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java index 3ab0048677c7..33638f767356 100644 --- a/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java +++ b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/config/WorkflowSettingsTest.java @@ -50,19 +50,19 @@ public void defaultValuesNotOverriddenByNulls(){ } @Test - public void newBuilderFromCopyShouldMutateSystemProperties(){ + public void newBuilderFromCopyShouldMutateGlobalProperties(){ WorkflowSettings original = WorkflowSettings.newBuilder() .withOutputDir("output") .withVerbose(true) .withSkipOverwrite(false) - .withSystemProperty("first", "1st") + .withGlobalProperty("first", "1st") .build(); WorkflowSettings modified = WorkflowSettings.newBuilder(original) - .withSystemProperty("second", "2nd") + .withGlobalProperty("second", "2nd") .build(); - Map properties = modified.getSystemProperties(); + Map properties = modified.getGlobalProperties(); assertEquals(properties.size(), 2, "System Properties map should allow mutation when invoked via copy constructor"); assertEquals(properties.getOrDefault("first", ""), "1st"); assertEquals(properties.getOrDefault("second", ""), "2nd"); diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index 7a8cef3596a5..2c10b0a8b342 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -135,10 +135,10 @@ apply plugin: 'org.openapi.generator' |None |Adds authorization headers when fetching the OpenAPI definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values. -|systemProperties +|globalProperties |Map(String,String) |None -|Sets specified system properties. +|Sets specified global properties. |configFile |String @@ -346,12 +346,12 @@ For more control over generation of individual files, configure an ignore file a [NOTE] ==== -When configuring `systemProperties` in order to perform selective generation you can disable generation of some parts by providing `"false"` value: +When configuring `globalProperties` in order to perform selective generation you can disable generation of some parts by providing `"false"` value: [source,groovy] ---- openApiGenerate { // other settings omitted - systemProperties = [ + globalProperties = [ modelDocs: "false", apis: "false" ] @@ -362,7 +362,7 @@ When enabling generation of only specific parts you either have to provide CSV l ---- openApiGenerate { // other settings omitted - systemProperties = [ + globalProperties = [ apis: "", models: "User,Pet" ] @@ -609,7 +609,7 @@ task buildKotlinClient(type: org.openapitools.generator.gradle.plugin.tasks.Gene configOptions = [ dateLibrary: "java8" ] - systemProperties = [ + globalProperties = [ modelDocs: "false" ] } diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle index 22a21f46c6ff..cb99b8838faa 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle @@ -42,7 +42,7 @@ openApiGenerate { configOptions = [ dateLibrary: "java8" ] - systemProperties = [ + globalProperties = [ modelDocs: "false" ] skipValidateSpec = true @@ -74,7 +74,7 @@ task buildDotnetSdk(type: org.openapitools.generator.gradle.plugin.tasks.Generat useCompareNetObjects: "true" ] outputDir = "$buildDir/csharp-netcore".toString() - systemProperties = [ + globalProperties = [ models: "", apis : "", ] diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt index dcc3ce08915d..84caadfad839 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt @@ -98,7 +98,7 @@ class OpenApiGeneratorPlugin : Plugin { inputSpec.set(generate.inputSpec) templateDir.set(generate.templateDir) auth.set(generate.auth) - systemProperties.set(generate.systemProperties) + globalProperties.set(generate.globalProperties) configFile.set(generate.configFile) skipOverwrite.set(generate.skipOverwrite) packageName.set(generate.packageName) diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt index daed01ae256e..4f099db7f6ff 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt @@ -65,9 +65,9 @@ open class OpenApiGeneratorGenerateExtension(project: Project) { val auth = project.objects.property() /** - * Sets specified system properties. + * Sets specified global properties. */ - val systemProperties = project.objects.mapProperty() + val globalProperties = project.objects.mapProperty() /** * Path to json configuration file. diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt index 81a7e918c141..500597599b36 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt @@ -97,10 +97,10 @@ open class GenerateTask : DefaultTask() { val auth = project.objects.property() /** - * Sets specified system properties. + * Sets specified global properties. */ @get:Internal - val systemProperties = project.objects.mapProperty() + val globalProperties = project.objects.mapProperty() /** * Path to json configuration file. @@ -415,9 +415,9 @@ open class GenerateTask : DefaultTask() { } else CodegenConfigurator() try { - if (systemProperties.isPresent) { - systemProperties.get().forEach { (key, value) -> - configurator.addSystemProperty(key, value) + if (globalProperties.isPresent) { + globalProperties.get().forEach { (key, value) -> + configurator.addGlobalProperty(key, value) } } @@ -582,10 +582,9 @@ open class GenerateTask : DefaultTask() { } } - if (systemProperties.isPresent) { - // TODO: rename to globalProperties in 5.0 - systemProperties.get().forEach { entry -> - configurator.addSystemProperty(entry.key, entry.value) + if (globalProperties.isPresent) { + globalProperties.get().forEach { entry -> + configurator.addGlobalProperty(entry.key, entry.value) } } diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 90703b7f6031..628c15390c94 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -85,14 +85,6 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(name = "verbose", defaultValue = "false") private boolean verbose; - // TODO: 5.0 Remove `language` option. - /** - * Client language to generate. - */ - @Parameter(name = "language") - private String language; - - /** * The name of the generator to use. */ @@ -538,20 +530,8 @@ public void execute() throws MojoExecutionException { configurator.setGenerateAliasAsModel(generateAliasAsModel); } - // TODO: After 3.0.0 release (maybe for 3.1.0): Fully deprecate lang. if (isNotEmpty(generatorName)) { configurator.setGeneratorName(generatorName); - - // check if generatorName & language are set together, inform user this needs to be updated to prevent future issues. - if (isNotEmpty(language)) { - LOGGER.warn("The 'language' option is deprecated and was replaced by 'generatorName'. Both can not be set together"); - throw new MojoExecutionException( - "Illegal configuration: 'language' and 'generatorName' can not be set both, remove 'language' from your configuration"); - } - } else if (isNotEmpty(language)) { - LOGGER.warn( - "The 'language' option is deprecated and may reference language names only in the next major release (4.0). Please use 'generatorName' instead."); - configurator.setGeneratorName(language); } else { LOGGER.error("A generator name (generatorName) is required."); throw new MojoExecutionException("The generator requires 'generatorName'. Refer to documentation for a list of options."); @@ -724,7 +704,7 @@ public void execute() throws MojoExecutionException { originalEnvironmentVariables.put(key, GlobalSettings.getProperty(key)); String value = environmentVariables.get(key); if (value != null) { - configurator.addSystemProperty(key, value); + configurator.addGlobalProperty(key, value); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index df0d00f44e77..8520b6053363 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -61,7 +61,7 @@ public class CodegenConfigurator { private String generatorName; private String inputSpec; private String templatingEngineName; - private Map systemProperties = new HashMap<>(); + private Map globalProperties = new HashMap<>(); private Map instantiationTypes = new HashMap<>(); private Map typeMappings = new HashMap<>(); private Map additionalProperties = new HashMap<>(); @@ -91,8 +91,8 @@ public static CodegenConfigurator fromFile(String configFile, Module... modules) configurator.generatorName = generatorSettings.getGeneratorName(); configurator.inputSpec = workflowSettings.getInputSpec(); configurator.templatingEngineName = workflowSettings.getTemplatingEngineName(); - if (workflowSettings.getSystemProperties() != null) { - configurator.systemProperties.putAll(workflowSettings.getSystemProperties()); + if (workflowSettings.getGlobalProperties() != null) { + configurator.globalProperties.putAll(workflowSettings.getGlobalProperties()); } if(generatorSettings.getInstantiationTypes() != null) { configurator.instantiationTypes.putAll(generatorSettings.getInstantiationTypes()); @@ -183,10 +183,9 @@ public CodegenConfigurator addLanguageSpecificPrimitive(String value) { return this; } - // TODO: rename this and other references to "global property" rather than "system property" - public CodegenConfigurator addSystemProperty(String key, String value) { - this.systemProperties.put(key, value); - workflowSettingsBuilder.withSystemProperty(key, value); + public CodegenConfigurator addGlobalProperty(String key, String value) { + this.globalProperties.put(key, value); + workflowSettingsBuilder.withGlobalProperty(key, value); return this; } @@ -385,9 +384,9 @@ public CodegenConfigurator setStrictSpecBehavior(boolean strictSpecBehavior) { return this; } - public CodegenConfigurator setSystemProperties(Map systemProperties) { - this.systemProperties = systemProperties; - workflowSettingsBuilder.withSystemProperties(systemProperties); + public CodegenConfigurator setGlobalProperties(Map globalProperties) { + this.globalProperties = globalProperties; + workflowSettingsBuilder.withGlobalProperties(globalProperties); return this; } @@ -450,7 +449,7 @@ public Context toContext() { GlobalSettings.setProperty("verbose", "false"); } - for (Map.Entry entry : workflowSettings.getSystemProperties().entrySet()) { + for (Map.Entry entry : workflowSettings.getGlobalProperties().entrySet()) { GlobalSettings.setProperty(entry.getKey(), entry.getValue()); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfiguratorUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfiguratorUtils.java index b3154db6407a..e6251baa8f04 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfiguratorUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfiguratorUtils.java @@ -42,39 +42,6 @@ */ public final class CodegenConfiguratorUtils { - /** - * Applies "system" properties to the configurator as global properties. - * - * @deprecated - * This method is deprecated due to confusion around the tool's use of system properties. We called these system properties - * in the past and accepted them via CLI option -D. This lead to confusion between true Java System Properties and generator-specific - * "system level properties". They've since been renamed as "Global Properties". Please use {@link CodegenConfiguratorUtils#applyGlobalPropertiesKvpList(List, CodegenConfigurator)}. - * - * @param systemProperties List of properties to be globally available throughout the generator execution. - * @param configurator The {@link CodegenConfigurator} instance to configure. - */ - @Deprecated - public static void applySystemPropertiesKvpList(List systemProperties, CodegenConfigurator configurator) { - // TODO: Remove in 5.0 - applyGlobalPropertiesKvpList(systemProperties, configurator); - } - - /** - * Applies a key-value pair of strings as "system" properties to the configurator as global properties. - * - * @deprecated - * This method is deprecated due to confusing between Java Sytsem Properties and generator-specific "system-level properties". - * They've since been renamed as "Global Properties". Please use {@link CodegenConfiguratorUtils#applyGlobalPropertiesKvp(String, CodegenConfigurator)}. - * - * @param systemProperties List of properties to be globally available throughout the generator execution. - * @param configurator The {@link CodegenConfigurator} instance to configure. - */ - @Deprecated - public static void applySystemPropertiesKvp(String systemProperties, CodegenConfigurator configurator) { - // TODO: Remove in 5.0 - applyGlobalPropertiesKvp(systemProperties, configurator); - } - public static void applyGlobalPropertiesKvpList(List globalProperties, CodegenConfigurator configurator) { for(String propString : globalProperties) { applyGlobalPropertiesKvp(propString, configurator); @@ -84,7 +51,7 @@ public static void applyGlobalPropertiesKvpList(List globalProperties, C public static void applyGlobalPropertiesKvp(String globalProperties, CodegenConfigurator configurator) { final Map map = createMapFromKeyValuePairs(globalProperties); for (Map.Entry entry : map.entrySet()) { - configurator.addSystemProperty(entry.getKey(), entry.getValue()); + configurator.addGlobalProperty(entry.getKey(), entry.getValue()); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java index 196ac1aa1815..17b687a3cf2b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractApexCodegen.java @@ -456,13 +456,6 @@ public CodegenModel fromModel(String name, Schema model) { } } - // TODO: 5.0: Remove this block and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - cm.vendorExtensions.put("hasPropertyMappings", !propertyMappings.isEmpty()); // TODO: 5.0 Remove - cm.vendorExtensions.put("hasDefaultValues", hasDefaultValues); // TODO: 5.0 Remove - cm.vendorExtensions.put("propertyMappings", propertyMappings); // TODO: 5.0 Remove - - cm.vendorExtensions.put("x-has-property-mappings", !propertyMappings.isEmpty()); cm.vendorExtensions.put("x-has-default-values", hasDefaultValues); cm.vendorExtensions.put("x-property-mappings", propertyMappings); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index ee16ccdd0ebf..7941bb05f4c8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -590,14 +590,11 @@ public void updateCodegenPropertyEnum(CodegenProperty var) { * @param models list of all models */ protected void updateValueTypeProperty(Map models) { - // TODO: 5.0: Remove the camelCased vendorExtension within the below loop and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); for (Map.Entry entry : models.entrySet()) { String openAPIName = entry.getKey(); CodegenModel model = ModelUtils.getModelByName(openAPIName, models); if (model != null) { for (CodegenProperty var : model.vars) { - var.vendorExtensions.put("isValueType", isValueType(var)); // TODO: 5.0 Remove var.vendorExtensions.put("x-is-value-type", isValueType(var)); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java index 82eba4b189c5..da78a87dd78d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java @@ -235,19 +235,14 @@ public void postProcessParameter(CodegenParameter parameter) { char firstChar = parameter.paramName.charAt(0); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - if (Character.isUpperCase(firstChar)) { // First char is already uppercase, just use paramName. - parameter.vendorExtensions.put("x-exportParamName", parameter.paramName); // TODO: 5.0 Remove parameter.vendorExtensions.put("x-export-param-name", parameter.paramName); } // It's a lowercase first char, let's convert it to uppercase StringBuilder sb = new StringBuilder(parameter.paramName); sb.setCharAt(0, Character.toUpperCase(firstChar)); - parameter.vendorExtensions.put("x-exportParamName", sb.toString()); // TODO: 5.0 Remove parameter.vendorExtensions.put("x-export-param-name", sb.toString()); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 5a7f9ae4e4f3..262ecaad0e29 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -457,9 +457,6 @@ public Map postProcessOperationsWithModels(Map o @SuppressWarnings("unchecked") List operations = (List) objectMap.get("operation"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (CodegenOperation operation : operations) { // http method verb conversion (e.g. PUT => Put) operation.httpMethod = camelize(operation.httpMethod.toLowerCase(Locale.ROOT)); @@ -525,12 +522,10 @@ public Map postProcessOperationsWithModels(Map o // We need to specially map Time type to the optionals package if ("time.Time".equals(param.dataType)) { - param.vendorExtensions.put("x-optionalDataType", "Time"); // TODO: 5.0 Remove param.vendorExtensions.put("x-optional-data-type", "Time"); } else { // Map optional type to dataType String optionalType = param.dataType.substring(0, 1).toUpperCase(Locale.ROOT) + param.dataType.substring(1); - param.vendorExtensions.put("x-optionalDataType", optionalType); // TODO: 5.0 Remove param.vendorExtensions.put("x-optional-data-type", optionalType); } } @@ -539,13 +534,11 @@ public Map postProcessOperationsWithModels(Map o char nameFirstChar = param.paramName.charAt(0); if (Character.isUpperCase(nameFirstChar)) { // First char is already uppercase, just use paramName. - param.vendorExtensions.put("x-exportParamName", param.paramName); // TODO: 5.0 Remove param.vendorExtensions.put("x-export-param-name", param.paramName); } else { // It's a lowercase first char, let's convert it to uppercase StringBuilder sb = new StringBuilder(param.paramName); sb.setCharAt(0, Character.toUpperCase(nameFirstChar)); - param.vendorExtensions.put("x-exportParamName", sb.toString()); // TODO: 5.0 Remove param.vendorExtensions.put("x-export-param-name", sb.toString()); } } @@ -579,21 +572,15 @@ public Map postProcessOperationsWithModels(Map o } private void setExportParameterName(List codegenParameters) { - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (CodegenParameter param : codegenParameters) { char nameFirstChar = param.paramName.charAt(0); if (Character.isUpperCase(nameFirstChar)) { // First char is already uppercase, just use paramName. - param.vendorExtensions.put("x-exportParamName", param.paramName); // TODO: 5.0 Remove param.vendorExtensions.put("x-export-param-name", param.paramName); } else { // It's a lowercase first char, let's convert it to uppercase StringBuilder sb = new StringBuilder(param.paramName); sb.setCharAt(0, Character.toUpperCase(nameFirstChar)); - param.vendorExtensions.put("x-exportParamName", sb.toString()); // TODO: 5.0 Remove param.vendorExtensions.put("x-export-param-name", sb.toString()); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index f4e35763adb1..badec0f64994 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -1034,12 +1034,7 @@ public CodegenModel fromModel(String name, Schema model) { public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { if (serializeBigDecimalAsString) { if (property.baseType.equals("BigDecimal")) { - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - // we serialize BigDecimal as `string` to avoid precision loss - property.vendorExtensions.put("extraAnnotation", "@JsonSerialize(using = ToStringSerializer.class)"); // TODO: 5.0 Remove property.vendorExtensions.put("x-extra-annotation", "@JsonSerialize(using = ToStringSerializer.class)"); // this requires some more imports to be added for this model... diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index 4592f21310a9..3a76a35649a0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -675,14 +675,9 @@ public Map postProcessModels(Map objs) { public Map postProcessOperationsWithModels(Map objs, List allModels) { Map operations = (Map) objs.get("operations"); List operationList = (List) operations.get("operation"); - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (CodegenOperation op : operationList) { // for API test method name // e.g. public function test{{vendorExtensions.x-testOperationId}}() - op.vendorExtensions.put("x-testOperationId", camelize(op.operationId)); // TODO: 5.0 Remove op.vendorExtensions.put("x-test-operation-id", camelize(op.operationId)); } return objs; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Apache2ConfigCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Apache2ConfigCodegen.java index 5cd7dfb6c679..cd0a392fb23d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Apache2ConfigCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Apache2ConfigCodegen.java @@ -96,9 +96,6 @@ public Map postProcessOperationsWithModels(Map o List operationList = (List) operations.get("operation"); List newOpList = new ArrayList(); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (CodegenOperation op : operationList) { String path = op.path; @@ -111,7 +108,6 @@ public Map postProcessOperationsWithModels(Map o splitPath.add(item); op.path += item + "/"; } - op.vendorExtensions.put("x-codegen-userInfoPath", userInfoPath); // TODO: 5.0 Remove op.vendorExtensions.put("x-codegen-user-info-path", userInfoPath); boolean foundInNewList = false; for (CodegenOperation op1 : newOpList) { @@ -124,7 +120,6 @@ public Map postProcessOperationsWithModels(Map o } op.operationIdCamelCase = op1.operationIdCamelCase; currentOtherMethodList.add(op); - op1.vendorExtensions.put("x-codegen-otherMethods", currentOtherMethodList); // TODO: 5.0 Remove op1.vendorExtensions.put("x-codegen-other-methods", currentOtherMethodList); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java index cb31f4f895d4..5af22a8d3f8f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ClojureClientCodegen.java @@ -47,7 +47,6 @@ public class ClojureClientCodegen extends DefaultCodegen implements CodegenConfi private static final String PROJECT_LICENSE_URL = "projectLicenseUrl"; private static final String BASE_NAMESPACE = "baseNamespace"; - static final String X_BASE_SPEC = "x-baseSpec"; // TODO: 5.0 Remove static final String VENDOR_EXTENSION_X_BASE_SPEC = "x-base-spec"; static final String X_MODELS = "x-models"; @@ -202,16 +201,10 @@ public String toModelName(String name) { @Override public CodegenModel fromModel(String name, Schema mod) { CodegenModel model = super.fromModel(name, mod); - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - // If a var is a base spec we won't need to import it for (CodegenProperty var : model.vars) { - var.vendorExtensions.put(X_BASE_SPEC, baseSpecs.contains(var.complexType)); // TODO: 5.0 Remove var.vendorExtensions.put(VENDOR_EXTENSION_X_BASE_SPEC, baseSpecs.contains(var.complexType)); if (var.items != null) { - var.items.vendorExtensions.put(X_BASE_SPEC, baseSpecs.contains(var.items.complexType)); // TODO: 5.0 Remove var.items.vendorExtensions.put(VENDOR_EXTENSION_X_BASE_SPEC, baseSpecs.contains(var.items.complexType)); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index 6a2368cd319f..6cd08e70a424 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -253,10 +253,6 @@ public Map postProcessOperationsWithModels(Map o String classname = (String) operations.get("classname"); operations.put("classnameSnakeUpperCase", underscore(classname).toUpperCase(Locale.ROOT)); operations.put("classnameSnakeLowerCase", underscore(classname).toLowerCase(Locale.ROOT)); - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - List operationList = (List) operations.get("operation"); for (CodegenOperation op : operationList) { boolean consumeJson = false; @@ -267,7 +263,6 @@ public Map postProcessOperationsWithModels(Map o } boolean isStringOrDate = op.bodyParam.isString || op.bodyParam.isDate; - op.bodyParam.vendorExtensions.put("x-codegen-pistache-isStringOrDate", isStringOrDate); // TODO: 5.0 Remove op.bodyParam.vendorExtensions.put("x-codegen-pistache-is-string-or-date", isStringOrDate); } if (op.consumes != null) { @@ -302,9 +297,7 @@ public Map postProcessOperationsWithModels(Map o if (op.vendorExtensions == null) { op.vendorExtensions = new HashMap<>(); } - op.vendorExtensions.put("x-codegen-pistache-consumesJson", consumeJson); // TODO: 5.0 Remove op.vendorExtensions.put("x-codegen-pistache-consumes-json", consumeJson); - op.vendorExtensions.put("x-codegen-pistache-isParsingSupported", isParsingSupported); // TODO: 5.0 Remove op.vendorExtensions.put("x-codegen-pistache-is-parsing-supported", isParsingSupported); // Check if any one of the operations needs a model, then at API file level, at least one model has to be included. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java index 09626e7a327f..c06fb7f66350 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java @@ -287,9 +287,6 @@ public Map postProcessOperationsWithModels(Map o List operationList = (List) operations.get("operation"); List newOpList = new ArrayList(); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (CodegenOperation op : operationList) { String path = op.path; @@ -311,7 +308,6 @@ public Map postProcessOperationsWithModels(Map o } op.path += item + "/"; } - op.vendorExtensions.put("x-codegen-resourceName", resourceNameCamelCase); // TODO: 5.0 Remove op.vendorExtensions.put("x-codegen-resource-name", resourceNameCamelCase); boolean foundInNewList = false; @@ -325,7 +321,6 @@ public Map postProcessOperationsWithModels(Map o } op.operationIdCamelCase = op1.operationIdCamelCase; currentOtherMethodList.add(op); - op1.vendorExtensions.put("x-codegen-otherMethods", currentOtherMethodList); // TODO: 5.0 Remove op1.vendorExtensions.put("x-codegen-other-methods", currentOtherMethodList); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 2a8de81aff62..ef750c05f8f1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -270,9 +270,6 @@ public Map postProcessModels(Map objs) { List models = (List) objs.get("models"); ProcessUtils.addIndexToProperties(models, 1); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (Object _mo : models) { Map mo = (Map) _mo; Set modelImports = new HashSet<>(); @@ -289,7 +286,6 @@ public Map postProcessModels(Map objs) { cm.imports = modelImports; boolean hasVars = cm.vars.size() > 0; - cm.vendorExtensions.put("hasVars", hasVars); // TODO: 5.0 Remove cm.vendorExtensions.put("x-has-vars", hasVars); } return objs; @@ -356,13 +352,6 @@ public Map postProcessOperationsWithModels(Map o } } - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - - op.vendorExtensions.put("isJson", isJson); // TODO: 5.0 Remove - op.vendorExtensions.put("isForm", isForm); // TODO: 5.0 Remove - op.vendorExtensions.put("isMultipart", isMultipart); // TODO: 5.0 Remove - op.vendorExtensions.put("x-is-json", isJson); op.vendorExtensions.put("x-is-form", isForm); op.vendorExtensions.put("x-is-multipart", isMultipart); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java index eabb64854a4c..c5042947a17b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java @@ -225,9 +225,6 @@ public Map postProcessModels(Map objs) { List models = (List) objs.get("models"); ProcessUtils.addIndexToProperties(models, 1); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (Object _mo : models) { Map mo = (Map) _mo; Set modelImports = new HashSet<>(); @@ -249,7 +246,6 @@ public Map postProcessModels(Map objs) { cm.imports = modelImports; boolean hasVars = cm.vars.size() > 0; - cm.vendorExtensions.put("hasVars", hasVars); // TODO: 5.0 Remove cm.vendorExtensions.put("x-has-vars", hasVars); } return objs; @@ -259,9 +255,6 @@ public Map postProcessModels(Map objs) { public Map postProcessOperationsWithModels(Map objs, List allModels) { objs = super.postProcessOperationsWithModels(objs, allModels); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - Map operations = (Map) objs.get("operations"); List operationList = (List) operations.get("operation"); @@ -305,11 +298,6 @@ public Map postProcessOperationsWithModels(Map o } } - op.vendorExtensions.put("isForm", isForm); // TODO: 5.0 Remove - op.vendorExtensions.put("isJson", isJson); // TODO: 5.0 Remove - op.vendorExtensions.put("isProto", isProto); // TODO: 5.0 Remove - op.vendorExtensions.put("isMultipart", isMultipart); // TODO: 5.0 Remove - op.vendorExtensions.put("x-is-form", isForm); op.vendorExtensions.put("x-is-json", isJson); op.vendorExtensions.put("x-is-proto", isProto); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index f0676b8e1873..00fc4e981756 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -38,7 +38,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import static org.openapitools.codegen.utils.OnceLogger.once; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -88,24 +87,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC static final String MIME_ANY = "MimeAny"; // vendor extensions. These must follow our convention of x- prefixed and lower-kebab cased. - static final String X_COLLECTION_FORMAT = "x-collectionFormat"; // TODO: 5.0 Remove - static final String X_HADDOCK_PATH = "x-haddockPath"; // TODO: 5.0 Remove - static final String X_HAS_BODY_OR_FORM_PARAM = "x-hasBodyOrFormParam"; // TODO: 5.0 Remove - static final String X_HAS_MIME_FORM_URL_ENCODED = "x-hasMimeFormUrlEncoded"; // TODO: 5.0 Remove - static final String X_HAS_NEW_TAG = "x-hasNewTag"; // TODO: 5.0 Remove - static final String X_HAS_OPTIONAL_PARAMS = "x-hasOptionalParams"; // TODO: 5.0 Remove - static final String X_HAS_UNKNOWN_RETURN = "x-hasUnknownReturn"; // TODO: 5.0 Remove - static final String X_INLINE_CONTENT_TYPE = "x-inlineContentType"; // TODO: 5.0 Remove - static final String X_INLINE_ACCEPT = "x-inlineAccept"; // TODO: 5.0 Remove - static final String X_IS_BODY_OR_FORM_PARAM = "x-isBodyOrFormParam"; // TODO: 5.0 Remove - static final String X_IS_MAYBE_VALUE = "x-isMaybeValue"; // TODO: 5.0 Remove - static final String X_DATA_TYPE = "x-dataType"; // TODO: 5.0 Remove - static final String X_MIME_TYPES = "x-mimeTypes"; // TODO: 5.0 Remove - static final String X_OPERATION_TYPE = "x-operationType"; // TODO: 5.0 Remove - static final String X_PARAM_NAME_TYPE = "x-paramNameType"; // TODO: 5.0 Remove - static final String X_RETURN_TYPE = "x-returnType"; // TODO: 5.0 Remove - static final String X_UNKNOWN_MIME_TYPES = "x-unknownMimeTypes"; // TODO: 5.0 Remove - + static final String VENDOR_EXTENSION_X_UNKNOWN_MIME_TYPES = "x-unknown-mime-types"; static final String VENDOR_EXTENSION_X_COLLECTION_FORMAT = "x-collection-format"; static final String VENDOR_EXTENSION_X_HADDOCK_PATH = "x-haddock-path"; static final String VENDOR_EXTENSION_X_HAS_BODY_OR_FORM_PARAM = "x-has-body-or-form-param"; @@ -687,10 +669,6 @@ public String toInstantiationType(Schema p) { @Override public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation op, Map> operations) { - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - List opList = operations.get(tag); if (opList == null || opList.isEmpty()) { opList = new ArrayList(); @@ -727,33 +705,25 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera op.vendorExtensions = new LinkedHashMap(); String operationType = toTypeName("Op", op.operationId); - op.vendorExtensions.put(X_OPERATION_TYPE, operationType); // TODO: 5.0 Remove op.vendorExtensions.put(VENDOR_EXTENSION_X_OPERATION_TYPE, operationType); typeNames.add(operationType); String xHaddockPath = String.format(Locale.ROOT, "%s %s", op.httpMethod, op.path.replace("/", "\\/")); - op.vendorExtensions.put(X_HADDOCK_PATH, xHaddockPath); // TODO: 5.0 Remove op.vendorExtensions.put(VENDOR_EXTENSION_X_HADDOCK_PATH, xHaddockPath); - op.vendorExtensions.put(X_HAS_BODY_OR_FORM_PARAM, op.getHasBodyParam() || op.getHasFormParams()); // TODO: 5.0 Remove op.vendorExtensions.put(VENDOR_EXTENSION_X_HAS_BODY_OR_FORM_PARAM, op.getHasBodyParam() || op.getHasFormParams()); for (CodegenParameter param : op.allParams) { param.vendorExtensions = new LinkedHashMap(); // prevent aliasing/sharing - param.vendorExtensions.put(X_OPERATION_TYPE, operationType); // TODO: 5.0 Remove param.vendorExtensions.put(VENDOR_EXTENSION_X_OPERATION_TYPE, operationType); - param.vendorExtensions.put(X_IS_BODY_OR_FORM_PARAM, param.isBodyParam || param.isFormParam); // TODO: 5.0 Remove param.vendorExtensions.put(VENDOR_EXTENSION_X_IS_BODY_OR_FORM_PARAM, param.isBodyParam || param.isFormParam); if (!StringUtils.isBlank(param.collectionFormat)) { - param.vendorExtensions.put(X_COLLECTION_FORMAT, mapCollectionFormat(param.collectionFormat)); // TODO: 5.0 Remove param.vendorExtensions.put(VENDOR_EXTENSION_X_COLLECTION_FORMAT, mapCollectionFormat(param.collectionFormat)); } else if (!param.isBodyParam && (param.isListContainer || param.dataType.startsWith("["))) { // param.isListContainer is sometimes false for list types // defaulting due to https://github.com/wing328/openapi-generator/issues/72 param.collectionFormat = "csv"; - param.vendorExtensions.put(X_COLLECTION_FORMAT, mapCollectionFormat(param.collectionFormat)); // TODO: 5.0 Remove param.vendorExtensions.put(VENDOR_EXTENSION_X_COLLECTION_FORMAT, mapCollectionFormat(param.collectionFormat)); } if (!param.required) { - op.vendorExtensions.put(X_HAS_OPTIONAL_PARAMS, true); // TODO: 5.0 Remove op.vendorExtensions.put(VENDOR_EXTENSION_X_HAS_OPTIONAL_PARAMS, true); } @@ -764,7 +734,6 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera String dataType = genEnums && param.isEnum ? param.datatypeWithEnum : param.dataType; String paramNameType = toDedupedModelName(toTypeName("Param", param.paramName), dataType, !(param.isEnum || param.allowableValues != null)); - param.vendorExtensions.put(X_PARAM_NAME_TYPE, paramNameType); // TODO: 5.0 Remove param.vendorExtensions.put(VENDOR_EXTENSION_X_PARAM_NAME_TYPE, paramNameType); HashMap props = new HashMap<>(); @@ -809,16 +778,16 @@ public int compare(Map o1, Map o2) { return o1.get(MEDIA_TYPE).compareTo(o2.get(MEDIA_TYPE)); } }); - additionalProperties.put(X_UNKNOWN_MIME_TYPES, unknownMimeTypes); + additionalProperties.put(VENDOR_EXTENSION_X_UNKNOWN_MIME_TYPES, unknownMimeTypes); ArrayList> params = new ArrayList<>(uniqueParamNameTypes.values()); Collections.sort(params, new Comparator>() { @Override public int compare(Map o1, Map o2) { return - ((String) o1.get(X_PARAM_NAME_TYPE)) + ((String) o1.get(VENDOR_EXTENSION_X_PARAM_NAME_TYPE)) .compareTo( - (String) o2.get(X_PARAM_NAME_TYPE)); + (String) o2.get(VENDOR_EXTENSION_X_PARAM_NAME_TYPE)); } }); additionalProperties.put(X_ALL_UNIQUE_PARAMS, params); @@ -827,14 +796,9 @@ public int compare(Map o1, Map o2) { @Override public Map postProcessOperationsWithModels(Map objs, List allModels) { Map ret = super.postProcessOperationsWithModels(objs, allModels); - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - HashMap pathOps = (HashMap) ret.get("operations"); ArrayList ops = (ArrayList) pathOps.get("operation"); if (ops.size() > 0) { - ops.get(0).vendorExtensions.put(X_HAS_NEW_TAG, true); // TODO: 5.0 Remove ops.get(0).vendorExtensions.put(VENDOR_EXTENSION_X_HAS_NEW_TAG, true); } @@ -846,7 +810,6 @@ public Map postProcessOperationsWithModels(Map o if (modelMimeTypes.containsKey(m.classname)) { Set mimeTypes = modelMimeTypes.get(m.classname); - m.vendorExtensions.put(X_MIME_TYPES, mimeTypes); // TODO: 5.0 Remove m.vendorExtensions.put(VENDOR_EXTENSION_X_MIME_TYPES, mimeTypes); if ((boolean) additionalProperties.get(PROP_GENERATE_FORM_URLENCODED_INSTANCES) && mimeTypes.contains("MimeFormUrlEncoded")) { @@ -857,7 +820,6 @@ public Map postProcessOperationsWithModels(Map o } } if (hasMimeFormUrlEncoded) { - m.vendorExtensions.put(X_HAS_MIME_FORM_URL_ENCODED, true); // TODO: 5.0 Remove m.vendorExtensions.put(VENDOR_EXTENSION_X_HAS_MIME_FORM_URL_ENCODED, true); } } @@ -919,14 +881,9 @@ private void processReturnType(CodegenOperation op) { if (returnType == null || returnType.equals("null")) { if (op.hasProduces) { returnType = "res"; - op.vendorExtensions.put(X_HAS_UNKNOWN_RETURN, true); // TODO: 5.0 Remove op.vendorExtensions.put(VENDOR_EXTENSION_X_HAS_UNKNOWN_RETURN, true); } else { returnType = "NoContent"; - // TODO: 5.0 Remove vendor extension usage which is not lower-kebab cased. - if (!op.vendorExtensions.containsKey(X_INLINE_ACCEPT)) { - SetNoContent(op, X_INLINE_ACCEPT); - } if (!op.vendorExtensions.containsKey(VENDOR_EXTENSION_X_INLINE_ACCEPT)) { SetNoContent(op, VENDOR_EXTENSION_X_INLINE_ACCEPT); } @@ -935,13 +892,11 @@ private void processReturnType(CodegenOperation op) { if (returnType.contains(" ")) { returnType = "(" + returnType + ")"; } - op.vendorExtensions.put(X_RETURN_TYPE, returnType); // TODO: 5.0 Remove op.vendorExtensions.put(VENDOR_EXTENSION_X_RETURN_TYPE, returnType); } private void processProducesConsumes(CodegenOperation op) { - if (!(Boolean) op.vendorExtensions.get(X_HAS_BODY_OR_FORM_PARAM)) { - SetNoContent(op, X_INLINE_CONTENT_TYPE); // TODO: 5.0 Remove + if (!(Boolean) op.vendorExtensions.get(VENDOR_EXTENSION_X_HAS_BODY_OR_FORM_PARAM)) { SetNoContent(op, VENDOR_EXTENSION_X_INLINE_CONTENT_TYPE); } if (op.hasConsumes) { @@ -979,20 +934,15 @@ private void processProducesConsumes(CodegenOperation op) { } private void processInlineConsumesContentType(CodegenOperation op, Map m) { - if (op.vendorExtensions.containsKey(X_INLINE_CONTENT_TYPE)) return; - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); + if (op.vendorExtensions.containsKey(VENDOR_EXTENSION_X_INLINE_CONTENT_TYPE)) return; if ((boolean) additionalProperties.get(PROP_INLINE_MIME_TYPES) && op.consumes.size() == 1 && !MIME_ANY.equals(op.consumes.get(0).get(X_MEDIA_DATA_TYPE)) && !MIME_NO_CONTENT.equals(op.consumes.get(0).get(X_MEDIA_DATA_TYPE))) { - op.vendorExtensions.put(X_INLINE_CONTENT_TYPE, m); // TODO: 5.0 Remove op.vendorExtensions.put(VENDOR_EXTENSION_X_INLINE_CONTENT_TYPE, m); for (CodegenParameter param : op.allParams) { if (param.isBodyParam && param.required) { - param.vendorExtensions.put(X_INLINE_CONTENT_TYPE, m); // TODO: 5.0 Remove param.vendorExtensions.put(VENDOR_EXTENSION_X_INLINE_CONTENT_TYPE, m); } } @@ -1005,10 +955,6 @@ private void processInlineProducesContentType(CodegenOperation op, Map lastParam = this.uniqueParamNameTypes.get(paramNameType); if (lastParam != null) { - String comparisonKey = lastParam.containsKey(VENDOR_EXTENSION_X_ENUM) ? X_ENUM_VALUES : X_DATA_TYPE; + String comparisonKey = lastParam.containsKey(VENDOR_EXTENSION_X_ENUM) ? X_ENUM_VALUES : VENDOR_EXTENSION_X_DATA_TYPE; String lastParamDataType = (String) lastParam.get(comparisonKey); if (lastParamDataType != null && lastParamDataType.equals(dataType)) { return true; @@ -1053,7 +999,7 @@ public Boolean isDuplicate(String paramNameType, String dataType) { private Pair isDuplicateEnumValues(String enumValues) { for (Map vs : uniqueParamNameTypes.values()) { if (enumValues.equals(vs.get(X_ENUM_VALUES))) { - return Pair.of(true, (String) vs.get(X_PARAM_NAME_TYPE)); + return Pair.of(true, (String) vs.get(VENDOR_EXTENSION_X_PARAM_NAME_TYPE)); } } return Pair.of(false, null); @@ -1062,8 +1008,8 @@ private Pair isDuplicateEnumValues(String enumValues) { private void addToUniques(String xGroup, String paramNameType, String dataType, Map props) { HashMap m = new HashMap<>(); - m.put(X_PARAM_NAME_TYPE, paramNameType); - m.put(X_DATA_TYPE, dataType); + m.put(VENDOR_EXTENSION_X_PARAM_NAME_TYPE, paramNameType); + m.put(VENDOR_EXTENSION_X_DATA_TYPE, dataType); m.put(xGroup, true); m.putAll(props); uniqueParamNameTypes.put(paramNameType, m); @@ -1323,9 +1269,6 @@ public String toDefaultValue(Schema p) { public Map postProcessModels(Map objs) { List models = (List) objs.get("models"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (Object _mo : models) { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); @@ -1335,10 +1278,8 @@ public Map postProcessModels(Map objs) { if (dataType == null && cm.isArrayModel) { // isAlias + arrayModelType missing "datatype" dataType = "[" + cm.arrayModelType + "]"; } - cm.vendorExtensions.put(X_DATA_TYPE, dataType); // TODO: 5.0 Remove cm.vendorExtensions.put(VENDOR_EXTENSION_X_DATA_TYPE, dataType); if (dataType.equals("Maybe A.Value")) { - cm.vendorExtensions.put(X_IS_MAYBE_VALUE, true); // TODO: 5.0 Remove cm.vendorExtensions.put(VENDOR_EXTENSION_X_IS_MAYBE_VALUE, true); } } @@ -1346,10 +1287,8 @@ public Map postProcessModels(Map objs) { String datatype = genEnums && !StringUtils.isBlank(var.datatypeWithEnum) ? var.datatypeWithEnum : var.dataType; - var.vendorExtensions.put(X_DATA_TYPE, datatype); // TODO: 5.0 Remove var.vendorExtensions.put(VENDOR_EXTENSION_X_DATA_TYPE, datatype); if (!var.required && datatype.equals("A.Value") || var.required && datatype.equals("Maybe A.Value")) { - var.vendorExtensions.put(X_IS_MAYBE_VALUE, true); // TODO: 5.0 Remove var.vendorExtensions.put(VENDOR_EXTENSION_X_IS_MAYBE_VALUE, true); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java index 857bc4a55e42..fab903fa4930 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java @@ -507,9 +507,6 @@ private List pathToClientType(String path, List pathPa public CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, List servers) { CodegenOperation op = super.fromOperation(resourcePath, httpMethod, operation, servers); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - List path = pathToServantRoute(op.path, op.pathParams); List type = pathToClientType(op.path, op.pathParams); @@ -562,7 +559,6 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op // store form parameter name in the vendor extensions for (CodegenParameter param : op.formParams) { - param.vendorExtensions.put("x-formParamName", camelize(param.baseName)); // TODO: 5.0 Remove param.vendorExtensions.put("x-form-param-name", camelize(param.baseName)); } @@ -577,14 +573,10 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op path.add("Verb '" + op.httpMethod.toUpperCase(Locale.ROOT) + " 200 '[JSON] " + returnType); type.add("m " + returnType); - op.vendorExtensions.put("x-routeType", joinStrings(" :> ", path)); // TODO: 5.0 Remove op.vendorExtensions.put("x-route-type", joinStrings(" :> ", path)); - op.vendorExtensions.put("x-clientType", joinStrings(" -> ", type)); // TODO: 5.0 Remove op.vendorExtensions.put("x-client-type", joinStrings(" -> ", type)); - op.vendorExtensions.put("x-formName", "Form" + camelize(op.operationId)); // TODO: 5.0 Remove op.vendorExtensions.put("x-form-name", "Form" + camelize(op.operationId)); for (CodegenParameter param : op.formParams) { - param.vendorExtensions.put("x-formPrefix", camelize(op.operationId, true)); // TODO: 5.0 Remove param.vendorExtensions.put("x-form-prefix", camelize(op.operationId, true)); } return op; @@ -642,9 +634,6 @@ private String fixModelChars(String string) { public CodegenModel fromModel(String name, Schema mod) { CodegenModel model = super.fromModel(name, mod); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - setGenerateToSchema(model); // Clean up the class name to remove invalid characters @@ -663,7 +652,6 @@ public CodegenModel fromModel(String name, Schema mod) { String dataOrNewtype = "data"; if (!"object".equals(model.dataType) && typeMapping.containsKey(model.dataType)) { String newtype = typeMapping.get(model.dataType); - model.vendorExtensions.put("x-customNewtype", newtype); // TODO: 5.0 Remove // note; newtype is a single lowercase word in Haskell (not separated by hyphen) model.vendorExtensions.put("x-custom-newtype", newtype); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 0a973ab0496f..5a5b618a202b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -750,14 +750,12 @@ public Map postProcessModelsEnum(Map objs) { return objs; } + @SuppressWarnings("unchecked") @Override public Map postProcessModels(Map objs) { objs = super.postProcessModels(objs); List models = (List) objs.get("models"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON) && !JERSEY1.equals(getLibrary())) { List> imports = (List>) objs.get("imports"); for (Object _mo : models) { @@ -768,7 +766,6 @@ public Map postProcessModels(Map objs) { boolean isOptionalNullable = Boolean.FALSE.equals(var.required) && Boolean.TRUE.equals(var.isNullable); // only add JsonNullable and related imports to optional and nullable values addImports |= isOptionalNullable; - var.getVendorExtensions().put("isJacksonOptionalNullable", isOptionalNullable); // TODO: 5.0 Remove var.getVendorExtensions().put("x-is-jackson-optional-nullable", isOptionalNullable); } if (addImports) { @@ -791,9 +788,8 @@ public Map postProcessModels(Map objs) { for (Object _mo : models) { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); - cm.getVendorExtensions().putIfAbsent("implements", new ArrayList()); // TODO: 5.0 Remove - cm.getVendorExtensions().putIfAbsent("x-implements", cm.getVendorExtensions().get("implements")); - //List impl = (List) cm.getVendorExtensions().get("x-implements"); + + cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList()); if (JERSEY2.equals(getLibrary())) { cm.getVendorExtensions().put("x-implements", new ArrayList()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java index fb6b93472dc8..1cfd2e63ad93 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaPlayFrameworkCodegen.java @@ -291,9 +291,6 @@ public void setUseSwaggerUI(boolean useSwaggerUI) { public Map postProcessOperationsWithModels(Map objs, List allModels) { Map operations = (Map) objs.get("operations"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - if (operations != null) { List ops = (List) operations.get("operation"); for (CodegenOperation operation : ops) { @@ -320,11 +317,9 @@ public Map postProcessOperationsWithModels(Map o if (operation.returnType != null) { if (operation.returnType.equals("Boolean")) { - operation.vendorExtensions.put("missingReturnInfoIfNeeded", "true"); // TODO: 5.0 Remove operation.vendorExtensions.put("x-missing-return-info-if-needed", "true"); } if (operation.returnType.equals("BigDecimal")) { - operation.vendorExtensions.put("missingReturnInfoIfNeeded", "1.0"); // TODO: 5.0 Remove operation.vendorExtensions.put("x-missing-return-info-if-needed", "1.0"); } if (operation.returnType.startsWith("List")) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java index a08486854ab6..b92c70e2aa10 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptApolloClientCodegen.java @@ -814,9 +814,6 @@ public String toOperationId(String operationId) { @Override public CodegenModel fromModel(String name, Schema model) { - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); CodegenModel codegenModel = super.fromModel(name, model); @@ -829,22 +826,17 @@ public CodegenModel fromModel(String name, Schema model) { ArraySchema am = (ArraySchema) model; if (codegenModel != null && am.getItems() != null) { String itemType = getSchemaType(am.getItems()); - codegenModel.vendorExtensions.put("x-isArray", true); // TODO: 5.0 Remove codegenModel.vendorExtensions.put("x-is-array", true); - codegenModel.vendorExtensions.put("x-itemType", itemType); // TODO: 5.0 Remove codegenModel.vendorExtensions.put("x-item-type", itemType); } } else if (ModelUtils.isMapSchema(model)) { if (codegenModel != null && getAdditionalProperties(model) != null) { String itemType = getSchemaType(getAdditionalProperties(model)); - codegenModel.vendorExtensions.put("x-isMap", true); // TODO: 5.0 Remove codegenModel.vendorExtensions.put("x-is-map", true); - codegenModel.vendorExtensions.put("x-itemType", itemType); // TODO: 5.0 Remove codegenModel.vendorExtensions.put("x-item-type", itemType); } else { String type = model.getType(); if (codegenModel != null && isPrimitiveType(type)) { - codegenModel.vendorExtensions.put("x-isPrimitive", true); // TODO: 5.0 Remove codegenModel.vendorExtensions.put("x-is-primitive", true); } } @@ -918,9 +910,6 @@ public Map postProcessOperationsWithModels(Map o // vendor-extension: x-codegen-argList. Map operations = (Map) objs.get("operations"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - if (operations != null) { List ops = (List) operations.get("operation"); for (CodegenOperation operation : ops) { @@ -944,9 +933,7 @@ public Map postProcessOperationsWithModels(Map o } String joinedArgList = StringUtils.join(argList, ", "); - operation.vendorExtensions.put("x-codegen-argList", joinedArgList); // TODO: 5.0 Remove operation.vendorExtensions.put("x-codegen-arg-list", joinedArgList); - operation.vendorExtensions.put("x-codegen-hasOptionalParams", hasOptionalParams); // TODO: 5.0 Remove operation.vendorExtensions.put("x-codegen-has-optional-params", hasOptionalParams); // Store JSDoc type specification into vendor-extension: x-jsdoc-type. @@ -972,9 +959,6 @@ public Map postProcessModels(Map objs) { objs = super.postProcessModelsEnum(objs); List models = (List) objs.get("models"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (Object _mo : models) { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); @@ -1025,10 +1009,8 @@ public Map postProcessModels(Map objs) { for (CodegenProperty var : cm.vars) { Optional.ofNullable(lastRequired).ifPresent(_lastRequired -> { if (var == _lastRequired) { - var.vendorExtensions.put("x-codegen-hasMoreRequired", false); // TODO: 5.0 Remove var.vendorExtensions.put("x-codegen-has-more-required", false); } else if (var.required) { - var.vendorExtensions.put("x-codegen-hasMoreRequired", true); // TODO: 5.0 Remove var.vendorExtensions.put("x-codegen-has-more-required", true); } }); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java index 092ecd658721..dddf793e81be 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java @@ -862,9 +862,6 @@ public String toOperationId(String operationId) { @Override public CodegenModel fromModel(String name, Schema model) { - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); CodegenModel codegenModel = super.fromModel(name, model); @@ -877,22 +874,17 @@ public CodegenModel fromModel(String name, Schema model) { ArraySchema am = (ArraySchema) model; if (codegenModel != null && am.getItems() != null) { String itemType = getSchemaType(am.getItems()); - codegenModel.vendorExtensions.put("x-isArray", true); // TODO: 5.0 Remove codegenModel.vendorExtensions.put("x-is-array", true); - codegenModel.vendorExtensions.put("x-itemType", itemType); // TODO: 5.0 Remove codegenModel.vendorExtensions.put("x-item-type", itemType); } } else if (ModelUtils.isMapSchema(model)) { if (codegenModel != null && getAdditionalProperties(model) != null) { String itemType = getSchemaType(getAdditionalProperties(model)); - codegenModel.vendorExtensions.put("x-isMap", true); // TODO: 5.0 Remove codegenModel.vendorExtensions.put("x-is-map", true); - codegenModel.vendorExtensions.put("x-itemType", itemType); // TODO: 5.0 Remove codegenModel.vendorExtensions.put("x-item-type", itemType); } else { String type = model.getType(); if (codegenModel != null && isPrimitiveType(type)) { - codegenModel.vendorExtensions.put("x-isPrimitive", true); // TODO: 5.0 Remove codegenModel.vendorExtensions.put("x-is-primitive", true); } } @@ -992,9 +984,6 @@ public Map postProcessOperationsWithModels(Map o // vendor-extension: x-codegen-argList. Map operations = (Map) objs.get("operations"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - if (operations != null) { List ops = (List) operations.get("operation"); for (CodegenOperation operation : ops) { @@ -1021,9 +1010,7 @@ public Map postProcessOperationsWithModels(Map o argList.add("callback"); } String joinedArgList = StringUtils.join(argList, ", "); - operation.vendorExtensions.put("x-codegen-argList", joinedArgList); // TODO: 5.0 Remove operation.vendorExtensions.put("x-codegen-arg-list", joinedArgList); - operation.vendorExtensions.put("x-codegen-hasOptionalParams", hasOptionalParams); // TODO: 5.0 Remove operation.vendorExtensions.put("x-codegen-has-optional-params", hasOptionalParams); // Store JSDoc type specification into vendor-extension: x-jsdoc-type. @@ -1049,9 +1036,6 @@ public Map postProcessModels(Map objs) { objs = super.postProcessModelsEnum(objs); List models = (List) objs.get("models"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (Object _mo : models) { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); @@ -1102,10 +1086,8 @@ public Map postProcessModels(Map objs) { for (CodegenProperty var : cm.vars) { Optional.ofNullable(lastRequired).ifPresent(_lastRequired -> { if (var == _lastRequired) { - var.vendorExtensions.put("x-codegen-hasMoreRequired", false); // TODO: 5.0 Remove var.vendorExtensions.put("x-codegen-has-more-required", false); } else if (var.required) { - var.vendorExtensions.put("x-codegen-hasMoreRequired", true); // TODO: 5.0 Remove var.vendorExtensions.put("x-codegen-has-more-required", true); } }); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java index 790dbd92322a..7abd38b276cf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java @@ -29,10 +29,10 @@ import static org.openapitools.codegen.utils.StringUtils.underscore; +@SuppressWarnings("unchecked") public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig { private static final Logger LOGGER = LoggerFactory.getLogger(MysqlSchemaCodegen.class); - public static final String CODEGEN_VENDOR_EXTENSION_KEY = "x-mysqlSchema"; // TODO: 5.0 Remove public static final String VENDOR_EXTENSION_MYSQL_SCHEMA = "x-mysql-schema"; public static final String DEFAULT_DATABASE_NAME = "defaultDatabaseName"; public static final String JSON_DATA_TYPE_ENABLED = "jsonDataTypeEnabled"; @@ -272,12 +272,11 @@ public Map postProcessModels(Map objs) { modelDescription = (modelDescription == null || modelDescription.isEmpty()) ? commentExtra : modelDescription + ". " + commentExtra; } - if (modelVendorExtensions.containsKey(CODEGEN_VENDOR_EXTENSION_KEY)) { + if (modelVendorExtensions.containsKey(VENDOR_EXTENSION_MYSQL_SCHEMA)) { // user already specified schema values LOGGER.info("Found vendor extension in '" + modelName + "' model, autogeneration skipped"); - continue; } else { - modelVendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); + modelVendorExtensions.put(VENDOR_EXTENSION_MYSQL_SCHEMA, mysqlSchema); mysqlSchema.put("tableDefinition", tableDefinition); tableDefinition.put("tblName", tableName); tableDefinition.put("tblComment", modelDescription); @@ -336,15 +335,15 @@ public void processIntegerTypeProperty(CodegenModel model, CodegenProperty prope String description = property.getDescription(); String minimum = property.getMinimum(); String maximum = property.getMaximum(); - Boolean exclusiveMinimum = property.getExclusiveMinimum(); - Boolean exclusiveMaximum = property.getIExclusiveMaximum(); + boolean exclusiveMinimum = property.getExclusiveMinimum(); + boolean exclusiveMaximum = property.getIExclusiveMaximum(); String defaultValue = property.getDefaultValue(); Boolean required = property.getRequired(); - Boolean unsigned = false; + boolean unsigned = false; Boolean isUuid = property.isUuid; Boolean isEnum = property.isEnum; - if (vendorExtensions.containsKey(CODEGEN_VENDOR_EXTENSION_KEY)) { + if (vendorExtensions.containsKey(VENDOR_EXTENSION_MYSQL_SCHEMA)) { // user already specified schema values LOGGER.info("Found vendor extension in '" + baseName + "' property, autogeneration skipped"); return; @@ -356,7 +355,6 @@ public void processIntegerTypeProperty(CodegenModel model, CodegenProperty prope description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; } - vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); // TODO: 5.0 Remove vendorExtensions.put(VENDOR_EXTENSION_MYSQL_SCHEMA, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); columnDefinition.put("colName", colName); @@ -364,7 +362,7 @@ public void processIntegerTypeProperty(CodegenModel model, CodegenProperty prope if (Boolean.TRUE.equals(isEnum)) { Map allowableValues = property.getAllowableValues(); List enumValues = (List) allowableValues.get("values"); - for (Integer i = 0; i < enumValues.size(); i++) { + for (int i = 0; i < enumValues.size(); i++) { if (i > ENUM_MAX_ELEMENTS - 1) { LOGGER.warn("ENUM column can have maximum of " + ENUM_MAX_ELEMENTS.toString() + " distinct elements, following value will be skipped: " + (String) enumValues.get(i)); break; @@ -380,8 +378,8 @@ public void processIntegerTypeProperty(CodegenModel model, CodegenProperty prope } else { Long min = (minimum != null) ? Long.parseLong(minimum) : null; Long max = (maximum != null) ? Long.parseLong(maximum) : null; - if (exclusiveMinimum == true && min != null) min += 1; - if (exclusiveMaximum == true && max != null) max -= 1; + if (exclusiveMinimum && min != null) min += 1; + if (exclusiveMaximum && max != null) max -= 1; if (min != null && min >= 0) { unsigned = true; } @@ -425,14 +423,14 @@ public void processDecimalTypeProperty(CodegenModel model, CodegenProperty prope String description = property.getDescription(); String minimum = property.getMinimum(); String maximum = property.getMaximum(); - Boolean exclusiveMinimum = property.getExclusiveMinimum(); - Boolean exclusiveMaximum = property.getIExclusiveMaximum(); + boolean exclusiveMinimum = property.getExclusiveMinimum(); + boolean exclusiveMaximum = property.getIExclusiveMaximum(); String defaultValue = property.getDefaultValue(); Boolean required = property.getRequired(); - Boolean unsigned = false; + boolean unsigned = false; Boolean isEnum = property.isEnum; - if (vendorExtensions.containsKey(CODEGEN_VENDOR_EXTENSION_KEY)) { + if (vendorExtensions.containsKey(VENDOR_EXTENSION_MYSQL_SCHEMA)) { // user already specified schema values LOGGER.info("Found vendor extension in '" + baseName + "' property, autogeneration skipped"); return; @@ -444,7 +442,6 @@ public void processDecimalTypeProperty(CodegenModel model, CodegenProperty prope description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; } - vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); // TODO: 5.0 Remove vendorExtensions.put(VENDOR_EXTENSION_MYSQL_SCHEMA, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); columnDefinition.put("colName", colName); @@ -452,7 +449,7 @@ public void processDecimalTypeProperty(CodegenModel model, CodegenProperty prope if (Boolean.TRUE.equals(isEnum)) { Map allowableValues = property.getAllowableValues(); List enumValues = (List) allowableValues.get("values"); - for (Integer i = 0; i < enumValues.size(); i++) { + for (int i = 0; i < enumValues.size(); i++) { if (i > ENUM_MAX_ELEMENTS - 1) { LOGGER.warn("ENUM column can have maximum of " + ENUM_MAX_ELEMENTS.toString() + " distinct elements, following value will be skipped: " + (String) enumValues.get(i)); break; @@ -465,8 +462,8 @@ public void processDecimalTypeProperty(CodegenModel model, CodegenProperty prope } else { Float min = (minimum != null) ? Float.valueOf(minimum) : null; Float max = (maximum != null) ? Float.valueOf(maximum) : null; - if (exclusiveMinimum == true && min != null) min += 1; - if (exclusiveMaximum == true && max != null) max -= 1; + if (exclusiveMinimum && min != null) min += 1; + if (exclusiveMaximum && max != null) max -= 1; if (min != null && min >= 0) { unsigned = true; } @@ -511,7 +508,7 @@ public void processBooleanTypeProperty(CodegenModel model, CodegenProperty prope String defaultValue = property.getDefaultValue(); Boolean required = property.getRequired(); - if (vendorExtensions.containsKey(CODEGEN_VENDOR_EXTENSION_KEY)) { + if (vendorExtensions.containsKey(VENDOR_EXTENSION_MYSQL_SCHEMA)) { // user already specified schema values LOGGER.info("Found vendor extension in '" + baseName + "' property, autogeneration skipped"); return; @@ -523,7 +520,6 @@ public void processBooleanTypeProperty(CodegenModel model, CodegenProperty prope description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; } - vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); // TODO: 5.0 Remove vendorExtensions.put(VENDOR_EXTENSION_MYSQL_SCHEMA, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); columnDefinition.put("colName", colName); @@ -570,7 +566,7 @@ public void processStringTypeProperty(CodegenModel model, CodegenProperty proper Boolean required = property.getRequired(); Boolean isEnum = property.isEnum; - if (vendorExtensions.containsKey(CODEGEN_VENDOR_EXTENSION_KEY)) { + if (vendorExtensions.containsKey(VENDOR_EXTENSION_MYSQL_SCHEMA)) { // user already specified schema values LOGGER.info("Found vendor extension in '" + baseName + "' property, autogeneration skipped"); return; @@ -582,7 +578,6 @@ public void processStringTypeProperty(CodegenModel model, CodegenProperty proper description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; } - vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); // TODO: 5.0 Remove vendorExtensions.put(VENDOR_EXTENSION_MYSQL_SCHEMA, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); columnDefinition.put("colName", colName); @@ -592,7 +587,7 @@ public void processStringTypeProperty(CodegenModel model, CodegenProperty proper List enumValues = (List) allowableValues.get("values"); columnDefinition.put("colDataType", "ENUM"); columnDefinition.put("colDataTypeArguments", columnDataTypeArguments); - for (Integer i = 0; i < enumValues.size(); i++) { + for (int i = 0; i < enumValues.size(); i++) { if (i > ENUM_MAX_ELEMENTS - 1) { LOGGER.warn("ENUM column can have maximum of " + ENUM_MAX_ELEMENTS.toString() + " distinct elements, following value will be skipped: " + (String) enumValues.get(i)); break; @@ -645,7 +640,7 @@ public void processDateTypeProperty(CodegenModel model, CodegenProperty property String description = property.getDescription(); String defaultValue = property.getDefaultValue(); - if (vendorExtensions.containsKey(CODEGEN_VENDOR_EXTENSION_KEY)) { + if (vendorExtensions.containsKey(VENDOR_EXTENSION_MYSQL_SCHEMA)) { // user already specified schema values LOGGER.info("Found vendor extension in '" + baseName + "' property, autogeneration skipped"); return; @@ -657,7 +652,6 @@ public void processDateTypeProperty(CodegenModel model, CodegenProperty property description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; } - vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); // TODO: 5.0 Remove vendorExtensions.put(VENDOR_EXTENSION_MYSQL_SCHEMA, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); columnDefinition.put("colName", colName); @@ -697,7 +691,7 @@ public void processJsonTypeProperty(CodegenModel model, CodegenProperty property String description = property.getDescription(); String defaultValue = property.getDefaultValue(); - if (vendorExtensions.containsKey(CODEGEN_VENDOR_EXTENSION_KEY)) { + if (vendorExtensions.containsKey(VENDOR_EXTENSION_MYSQL_SCHEMA)) { // user already specified schema values LOGGER.info("Found vendor extension in '" + baseName + "' property, autogeneration skipped"); return; @@ -709,7 +703,6 @@ public void processJsonTypeProperty(CodegenModel model, CodegenProperty property description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; } - vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); // TODO: 5.0 Remove vendorExtensions.put(VENDOR_EXTENSION_MYSQL_SCHEMA, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); columnDefinition.put("colName", colName); @@ -752,7 +745,7 @@ public void processUnknownTypeProperty(CodegenModel model, CodegenProperty prope String description = property.getDescription(); String defaultValue = property.getDefaultValue(); - if (vendorExtensions.containsKey(CODEGEN_VENDOR_EXTENSION_KEY)) { + if (vendorExtensions.containsKey(VENDOR_EXTENSION_MYSQL_SCHEMA)) { // user already specified schema values LOGGER.info("Found vendor extension in '" + baseName + "' property, autogeneration skipped"); return; @@ -764,7 +757,6 @@ public void processUnknownTypeProperty(CodegenModel model, CodegenProperty prope description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra; } - vendorExtensions.put(CODEGEN_VENDOR_EXTENSION_KEY, mysqlSchema); // TODO: 5.0 Remove vendorExtensions.put(VENDOR_EXTENSION_MYSQL_SCHEMA, mysqlSchema); mysqlSchema.put("columnDefinition", columnDefinition); columnDefinition.put("colName", colName); @@ -903,10 +895,10 @@ public HashMap toCodegenMysqlDataTypeDefault(String defaultValue public String getMysqlMatchedIntegerDataType(Long minimum, Long maximum, Boolean unsigned) { // we can choose fit mysql data type // ref: https://dev.mysql.com/doc/refman/8.0/en/integer-types.html - Long min = (minimum != null) ? minimum : -2147483648L; - Long max = (maximum != null) ? maximum : 2147483647L; - Long actualMin = Math.min(min, max); // sometimes min and max values can be mixed up - Long actualMax = Math.max(min, max); // sometimes only minimum specified and it can be pretty high + long min = (minimum != null) ? minimum : -2147483648L; + long max = (maximum != null) ? maximum : 2147483647L; + long actualMin = Math.min(min, max); // sometimes min and max values can be mixed up + long actualMax = Math.max(min, max); // sometimes only minimum specified and it can be pretty high if (minimum != null && maximum != null && minimum > maximum) { LOGGER.warn("Codegen property 'minimum' cannot be greater than 'maximum'"); } @@ -949,8 +941,8 @@ public String getMysqlMatchedIntegerDataType(Long minimum, Long maximum, Boolean public String getMysqlMatchedStringDataType(Integer minLength, Integer maxLength) { // we can choose fit mysql data type // ref: https://dev.mysql.com/doc/refman/8.0/en/string-type-overview.html - Integer min = (minLength != null && minLength >= 0) ? minLength : 0; - Integer max = (maxLength != null && maxLength >= 0) ? maxLength : 65535; + int min = (minLength != null && minLength >= 0) ? minLength : 0; + int max = (maxLength != null && maxLength >= 0) ? maxLength : 65535; Integer actualMin = Math.min(min, max); // sometimes minLength and maxLength values can be mixed up Integer actualMax = Math.max(min, max); // sometimes only minLength specified and it can be pretty high if (minLength != null && maxLength != null && minLength > maxLength) { @@ -1140,7 +1132,7 @@ public String escapeUnsafeCharacters(String input) { */ public void setDefaultDatabaseName(String databaseName) { String escapedName = toDatabaseName(databaseName); - if (escapedName.equals(databaseName) == false) { + if (!escapedName.equals(databaseName)) { LOGGER.error("Invalid database name. '" + databaseName + "' cannot be used as MySQL identifier. Escaped value '" + escapedName + "' will be used instead."); } this.defaultDatabaseName = escapedName; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java index 4d6d038c73be..f75ff87698f2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java @@ -45,7 +45,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig public static final String PACKAGE_NAME = "packageName"; public static final String PACKAGE_VERSION = "packageVersion"; - static final String X_MODEL_MODULE = "x-modelModule"; + static final String X_MODEL_MODULE = "x-model-module"; public static final String CO_HTTP = "cohttp"; @@ -715,9 +715,6 @@ public Map postProcessOperationsWithModels(Map o @SuppressWarnings("unchecked") List operations = (List) objectMap.get("operation"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (CodegenOperation operation : operations) { // http method verb conversion, depending on client library (e.g. Hyper: PUT => Put, Reqwest: PUT => put) //if (CO_HTTP.equals(getLibrary())) { @@ -728,7 +725,6 @@ public Map postProcessOperationsWithModels(Map o } if ("Yojson.Safe.t".equals(operation.returnBaseType)) { - operation.vendorExtensions.put("x-returnFreeFormObject", true); // TODO: 5.0 Remove operation.vendorExtensions.put("x-return-free-form-object", true); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java index abeeeffa2697..b8dd22f8d577 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java @@ -654,15 +654,11 @@ public void setLicense(String license) { public Map postProcessOperationsWithModels(Map objs, List allModels) { Map operations = (Map) objs.get("operations"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - if (operations != null) { List ops = (List) operations.get("operation"); for (CodegenOperation operation : ops) { if (!operation.allParams.isEmpty()) { String firstParamName = operation.allParams.get(0).paramName; - operation.vendorExtensions.put("firstParamAltName", camelize(firstParamName)); // TODO: 5.0 Remove operation.vendorExtensions.put("x-first-param-alt-name", camelize(firstParamName)); } } @@ -673,11 +669,6 @@ public Map postProcessOperationsWithModels(Map o @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty schema) { super.postProcessModelProperty(model, schema); - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - - schema.vendorExtensions.put("x-uppercaseName", camelize(schema.name)); // TODO: 5.0 Remove schema.vendorExtensions.put("x-uppercase-name", camelize(schema.name)); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java index 14de1216d4c0..30c41f7f2910 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java @@ -390,9 +390,6 @@ public void processOpts() { public Map postProcessOperationsWithModels(Map objs, List allModels) { objs = super.postProcessOperationsWithModels(objs, allModels); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - Map operations = (Map) objs.get("operations"); operations.put("controllerName", toControllerName((String) operations.get("pathPrefix"))); operations.put("symfonyService", toSymfonyService((String) operations.get("pathPrefix"))); @@ -408,20 +405,16 @@ public Map postProcessOperationsWithModels(Map o // to the templating engine String typeHint = getTypeHint(param.dataType); if (!typeHint.isEmpty()) { - param.vendorExtensions.put("x-parameterType", typeHint); // TODO: 5.0 Remove param.vendorExtensions.put("x-parameter-type", typeHint); } if (param.isContainer) { - param.vendorExtensions.put("x-parameterType", getTypeHint(param.dataType + "[]")); // TODO: 5.0 Remove param.vendorExtensions.put("x-parameter-type", getTypeHint(param.dataType + "[]")); } // Create a variable to display the correct data type in comments for interfaces - param.vendorExtensions.put("x-commentType", param.dataType); // TODO: 5.0 Remove param.vendorExtensions.put("x-comment-type", param.dataType); if (param.isContainer) { - param.vendorExtensions.put("x-commentType", param.dataType + "[]"); // TODO: 5.0 Remove param.vendorExtensions.put("x-comment-type", param.dataType + "[]"); } @@ -436,14 +429,11 @@ public Map postProcessOperationsWithModels(Map o // Create a variable to display the correct return type in comments for interfaces if (op.returnType != null) { - op.vendorExtensions.put("x-commentType", op.returnType); // TODO: 5.0 Remove op.vendorExtensions.put("x-comment-type", op.returnType); if (op.returnContainer != null && op.returnContainer.equals("array")) { - op.vendorExtensions.put("x-commentType", op.returnType + "[]"); // TODO: 5.0 Remove op.vendorExtensions.put("x-comment-type", op.returnType + "[]"); } } else { - op.vendorExtensions.put("x-commentType", "void"); // TODO: 5.0 Remove op.vendorExtensions.put("x-comment-type", "void"); } @@ -466,9 +456,6 @@ public Map postProcessOperationsWithModels(Map o public Map postProcessModels(Map objs) { objs = super.postProcessModels(objs); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - ArrayList modelsArray = (ArrayList) objs.get("models"); Map models = (Map) modelsArray.get(0); CodegenModel model = (CodegenModel) models.get("model"); @@ -480,20 +467,16 @@ public Map postProcessModels(Map objs) { // to the templating engine String typeHint = getTypeHint(var.dataType); if (!typeHint.isEmpty()) { - var.vendorExtensions.put("x-parameterType", typeHint); // TODO: 5.0 Remove var.vendorExtensions.put("x-parameter-type", typeHint); } if (var.isContainer) { - var.vendorExtensions.put("x-parameterType", getTypeHint(var.dataType + "[]")); // TODO: 5.0 Remove var.vendorExtensions.put("x-parameter-type", getTypeHint(var.dataType + "[]")); } // Create a variable to display the correct data type in comments for models - var.vendorExtensions.put("x-commentType", var.dataType); // TODO: 5.0 Remove var.vendorExtensions.put("x-comment-type", var.dataType); if (var.isContainer) { - var.vendorExtensions.put("x-commentType", var.dataType + "[]"); // TODO: 5.0 Remove var.vendorExtensions.put("x-comment-type", var.dataType + "[]"); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpZendExpressivePathHandlerServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpZendExpressivePathHandlerServerCodegen.java index 39732835cf91..ee2099b6af89 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpZendExpressivePathHandlerServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpZendExpressivePathHandlerServerCodegen.java @@ -36,6 +36,7 @@ public class PhpZendExpressivePathHandlerServerCodegen extends AbstractPhpCodegen { private static final Logger LOGGER = LoggerFactory.getLogger(PhpZendExpressivePathHandlerServerCodegen.class); + // TODO: Rename to x- prefixed vendor extensions, per specification. public static final String VEN_FROM_QUERY = "internal.ze-ph.fromQuery"; public static final String VEN_COLLECTION_FORMAT = "internal.ze-ph.collectionFormat"; public static final String VEN_QUERY_DATA_TYPE = "internal.ze-ph.queryDataType"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java index 31d4610f86ca..bd6e45bd223f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java @@ -198,9 +198,6 @@ public Map postProcessAllModels(Map objs) { // Index all CodegenModels by model name. Map allModels = new HashMap<>(); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (Map.Entry entry : objs.entrySet()) { String modelName = toModelName(entry.getKey()); Map inner = (Map) entry.getValue(); @@ -229,9 +226,7 @@ public Map postProcessAllModels(Map objs) { } // TODO: figure out how to properly have the original property type that didn't go through toVarName String vendorExtensionTagName = cm.discriminator.getPropertyName().replace("_", ""); - cm.vendorExtensions.put("tagName", vendorExtensionTagName); // TODO: 5.0 Remove cm.vendorExtensions.put("x-tag-name", vendorExtensionTagName); - cm.vendorExtensions.put("mappedModels", discriminatorVars); // TODO: 5.0 Remove cm.vendorExtensions.put("x-mapped-models", discriminatorVars); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index 80fd3dd58e24..e7de4e326498 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -609,9 +609,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation Map definitions = ModelUtils.getSchemas(this.openAPI); CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - String pathFormatString = op.path; for (CodegenParameter param : op.pathParams) { // Replace {baseName} with {paramName} for format string @@ -705,7 +702,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation hasPathParams = true; } - op.vendorExtensions.put("callbackParams", params); + op.vendorExtensions.put("x-callback-params", params); } // Save off the regular expression and path details in the relevant @@ -735,28 +732,20 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation } String underscoredOperationId = underscore(op.operationId); - op.vendorExtensions.put("operation_id", underscoredOperationId); // TODO: 5.0 Remove op.vendorExtensions.put("x-operation-id", underscoredOperationId); - op.vendorExtensions.put("uppercase_operation_id", underscoredOperationId.toUpperCase(Locale.ROOT)); // TODO: 5.0 Remove op.vendorExtensions.put("x-uppercase-operation-id", underscoredOperationId.toUpperCase(Locale.ROOT)); String vendorExtensionPath = op.path.replace("{", ":").replace("}", ""); - op.vendorExtensions.put("path", vendorExtensionPath); // TODO: 5.0 Remove op.vendorExtensions.put("x-path",vendorExtensionPath); - op.vendorExtensions.put("PATH_ID", pathId); // TODO: 5.0 Remove op.vendorExtensions.put("x-path-id", pathId); - op.vendorExtensions.put("hasPathParams", !op.pathParams.isEmpty()); // TODO: 5.0 Remove - op.vendorExtensions.put("x-has-path-params", !op.pathParams.isEmpty()); - op.vendorExtensions.put("hasPathParams", hasPathParams); // TODO: 5.0 Remove + op.vendorExtensions.put("x-has-path-params", hasPathParams); op.vendorExtensions.put("x-path-format-string", formatPath); String vendorExtensionHttpMethod = op.httpMethod.toUpperCase(Locale.ROOT); - op.vendorExtensions.put("HttpMethod", vendorExtensionHttpMethod); // TODO: 5.0 Remove op.vendorExtensions.put("x-http-method", vendorExtensionHttpMethod); - // TODO: 5.0 Fix formatting - if (!op.vendorExtensions.containsKey("x-mustUseResponse")) { + if (!op.vendorExtensions.containsKey("x-must-use-response")) { // If there's more than one response, than by default the user must explicitly handle them - op.vendorExtensions.put("x-mustUseResponse", op.responses.size() > 1); + op.vendorExtensions.put("x-must-use-response", op.responses.size() > 1); } for (CodegenParameter param : op.allParams) { @@ -800,7 +789,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation processParam(param, op); // Give header params a name in camel case. CodegenParameters don't have a nameInCamelCase property. - param.vendorExtensions.put("typeName", toModelName(param.baseName)); // TODO: 5.0 Remove param.vendorExtensions.put("x-type-name", toModelName(param.baseName)); } @@ -822,9 +810,9 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation // Create a unique responseID for this response. String responseId; - if (rsp.vendorExtensions.containsKey("x-responseId")) { + if (rsp.vendorExtensions.containsKey("x-response-id")) { // If it's been specified directly, use that. - responseId = (String) rsp.vendorExtensions.get("x-responseId"); + responseId = (String) rsp.vendorExtensions.get("x-response-id"); } else if ((words.length != 0) && (words[0].trim().length() != 0)) { // If there's a description, build it from the description. responseId = camelize(words[0].replace(" ", "_")); @@ -850,15 +838,11 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation responseIds.add(responseId); String underscoredResponseId = underscore(responseId).toUpperCase(Locale.ROOT); - rsp.vendorExtensions.put("x-responseId", responseId); // TODO: 5.0 Remove rsp.vendorExtensions.put("x-response-id", responseId); - rsp.vendorExtensions.put("x-uppercaseResponseId", underscoredResponseId.toUpperCase(Locale.ROOT)); // TODO: 5.0 Remove rsp.vendorExtensions.put("x-uppercase-response-id", underscoredResponseId.toUpperCase(Locale.ROOT)); - rsp.vendorExtensions.put("uppercase_operation_id", underscoredOperationId.toUpperCase(Locale.ROOT)); // TODO: 5.0 Remove rsp.vendorExtensions.put("x-uppercase-operation-id", underscoredOperationId.toUpperCase(Locale.ROOT)); if (rsp.dataType != null) { String uppercaseDataType = (rsp.dataType.replace("models::", "")).toUpperCase(Locale.ROOT); - rsp.vendorExtensions.put("uppercase_data_type", uppercaseDataType); // TODO: 5.0 Remove rsp.vendorExtensions.put("x-uppercase-data-type", uppercaseDataType); // Get the mimetype which is produced by this response. Note @@ -908,13 +892,11 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation outputMime = firstProduces; } - rsp.vendorExtensions.put("mimeType", outputMime); // TODO: 5.0 Remove rsp.vendorExtensions.put("x-mime-type", outputMime); // Write out the type of data we actually expect this response // to make. if (producesXml) { - rsp.vendorExtensions.put("producesXml", true); // TODO: 5.0 Remove rsp.vendorExtensions.put("x-produces-xml", true); } else if (producesPlainText) { // Plain text means that there is not structured data in @@ -926,14 +908,11 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation // base64 encoding should be done. They both look like // 'producesBytes'. if (rsp.dataType.equals(bytesType)) { - rsp.vendorExtensions.put("producesBytes", true); // TODO: 5.0 Remove rsp.vendorExtensions.put("x-produces-bytes", true); } else { - rsp.vendorExtensions.put("producesPlainText", true); // TODO: 5.0 Remove rsp.vendorExtensions.put("x-produces-plain-text", true); } } else { - rsp.vendorExtensions.put("producesJson", true); // TODO: 5.0 Remove rsp.vendorExtensions.put("x-produces-json", true); // If the data type is just "object", then ensure that the // Rust data type is "serde_json::Value". This allows us @@ -950,7 +929,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation if ((model != null)) { XML xml = model.getXml(); if ((xml != null) && (xml.getNamespace() != null)) { - rsp.vendorExtensions.put("has_namespace", "true"); // TODO: 5.0 Remove rsp.vendorExtensions.put("x-has-namespace", "true"); } } @@ -996,9 +974,6 @@ private void postProcessOperationWithModels(CodegenOperation op, List al boolean consumesPlainText = false; boolean consumesXml = false; - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - if (op.consumes != null) { for (Map consume : op.consumes) { if (consume.get("mediaType") != null) { @@ -1012,12 +987,11 @@ private void postProcessOperationWithModels(CodegenOperation op, List al } else if (isMimetypeWwwFormUrlEncoded(mediaType)) { additionalProperties.put("usesUrlEncodedForm", true); } else if (isMimetypeMultipartFormData(mediaType)) { - op.vendorExtensions.put("consumesMultipart", true); // TODO Remove: 5.0 Remove op.vendorExtensions.put("x-consumes-multipart", true); additionalProperties.put("apiUsesMultipartFormData", true); additionalProperties.put("apiUsesMultipart", true); } else if (isMimetypeMultipartRelated(mediaType)) { - op.vendorExtensions.put("consumesMultipartRelated", true); + op.vendorExtensions.put("x-consumes-multipart-related", true); additionalProperties.put("apiUsesMultipartRelated", true); additionalProperties.put("apiUsesMultipart", true); } @@ -1028,16 +1002,12 @@ private void postProcessOperationWithModels(CodegenOperation op, List al String underscoredOperationId = underscore(op.operationId).toUpperCase(Locale.ROOT); if (op.bodyParam != null) { // Default to consuming json - op.bodyParam.vendorExtensions.put("uppercase_operation_id", underscoredOperationId); // TODO: 5.0 Remove op.bodyParam.vendorExtensions.put("x-uppercase-operation-id", underscoredOperationId); if (consumesXml) { - op.bodyParam.vendorExtensions.put("consumesXml", true); // TODO: 5.0 Remove op.bodyParam.vendorExtensions.put("x-consumes-xml", true); } else if (consumesPlainText) { - op.bodyParam.vendorExtensions.put("consumesPlainText", true); // TODO: 5.0 Remove op.bodyParam.vendorExtensions.put("x-consumes-plain-text", true); } else { - op.bodyParam.vendorExtensions.put("consumesJson", true); // TODO: 5.0 Remove op.bodyParam.vendorExtensions.put("x-consumes-json", true); } } @@ -1045,18 +1015,14 @@ private void postProcessOperationWithModels(CodegenOperation op, List al for (CodegenParameter param : op.bodyParams) { processParam(param, op); - param.vendorExtensions.put("uppercase_operation_id", underscoredOperationId); // TODO: 5.0 Remove param.vendorExtensions.put("x-uppercase-operation-id", underscoredOperationId); // Default to producing json if nothing else is specified if (consumesXml) { - param.vendorExtensions.put("consumesXml", true); // TODO: 5.0 Remove param.vendorExtensions.put("x-consumes-xml", true); } else if (consumesPlainText) { - param.vendorExtensions.put("consumesPlainText", true); // TODO: 5.0 Remove param.vendorExtensions.put("x-consumes-plain-text", true); } else { - param.vendorExtensions.put("consumesJson", true); // TODO: 5.0 Remove param.vendorExtensions.put("x-consumes-json", true); } } @@ -1082,7 +1048,6 @@ private void postProcessOperationWithModels(CodegenOperation op, List al for (CodegenSecurity s : op.authMethods) { if (s.isApiKey && s.isKeyInHeader) { - s.vendorExtensions.put("x-apiKeyName", toModelName(s.keyParamName)); // TODO: 5.0 Remove s.vendorExtensions.put("x-api-key-name", toModelName(s.keyParamName)); headerAuthMethods = true; } @@ -1093,7 +1058,6 @@ private void postProcessOperationWithModels(CodegenOperation op, List al } if (headerAuthMethods) { - op.vendorExtensions.put("hasHeaderAuthMethods", "true"); // TODO: 5.0 Remove op.vendorExtensions.put("x-has-header-auth-methods", "true"); } } @@ -1220,13 +1184,8 @@ public String toInstantiationType(Schema p) { @Override public CodegenModel fromModel(String name, Schema model) { - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); CodegenModel mdl = super.fromModel(name, model); - mdl.vendorExtensions.put("upperCaseName", name.toUpperCase(Locale.ROOT)); // TODO: 5.0 Remove mdl.vendorExtensions.put("x-upper-case-name", name.toUpperCase(Locale.ROOT)); if (!StringUtils.isEmpty(model.get$ref())) { Schema schema = allDefinitions.get(ModelUtils.getSimpleRef(model.get$ref())); @@ -1258,7 +1217,6 @@ public CodegenModel fromModel(String name, Schema model) { // If this model's items require wrapping in xml, squirrel away the // xml name so we can insert it into the relevant model fields. if (xmlName != null) { - mdl.vendorExtensions.put("itemXmlName", xmlName); // TODO: 5.0 Remove mdl.vendorExtensions.put("x-item-xml-name", xmlName); modelXmlNames.put("models::" + mdl.classname, xmlName); } @@ -1287,9 +1245,6 @@ public CodegenModel fromModel(String name, Schema model) { public Map postProcessAllModels(Map objs) { Map newObjs = super.postProcessAllModels(objs); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - //Index all CodegenModels by model name. HashMap allModels = new HashMap(); for (Entry entry : objs.entrySet()) { @@ -1317,7 +1272,6 @@ public Map postProcessAllModels(Map objs) { String xmlName = modelXmlNames.get(prop.dataType); if (xmlName != null) { - prop.vendorExtensions.put("itemXmlName", xmlName); // TODO: 5.0 Remove prop.vendorExtensions.put("x-item-xml-name", xmlName); } @@ -1564,9 +1518,6 @@ private String matchingIntType(boolean unsigned, Long inclusiveMin, Long inclusi public Map postProcessModels(Map objs) { List models = (List) objs.get("models"); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (Object _mo : models) { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); @@ -1608,7 +1559,6 @@ public Map postProcessModels(Map objs) { } } - cm.vendorExtensions.put("isString", "String".equals(cm.dataType)); // TODO: 5.0 Remove cm.vendorExtensions.put("x-is-string", "String".equals(cm.dataType)); } return super.postProcessModelsEnum(objs); @@ -1618,38 +1568,30 @@ private void processParam(CodegenParameter param, CodegenOperation op) { String example = null; - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - // If a parameter uses UUIDs, we need to import the UUID package. if (uuidType.equals(param.dataType)) { additionalProperties.put("apiUsesUuid", true); } if (Boolean.TRUE.equals(param.isFreeFormObject)) { - param.vendorExtensions.put("formatString", "{:?}"); + param.vendorExtensions.put("x-format-string", "{:?}"); example = null; } else if (param.isString) { - param.vendorExtensions.put("formatString", "\\\"{}\\\""); // TODO: 5.0 Remove - param.vendorExtensions.put("x-format-string", "\\\"{}\\\""); // TODO: 5.0 Remove + param.vendorExtensions.put("x-format-string", "\\\"{}\\\""); example = "\"" + ((param.example != null) ? param.example : "") + "\".to_string()"; } else if (param.isPrimitiveType) { if ((param.isByteArray) || (param.isBinary)) { // Binary primitive types don't implement `Display`. - param.vendorExtensions.put("formatString", "{:?}"); // TODO: 5.0 Remove param.vendorExtensions.put("x-format-string", "{:?}"); example = "swagger::ByteArray(Vec::from(\"" + ((param.example != null) ? param.example : "") + "\"))"; } else { - param.vendorExtensions.put("formatString", "{}"); // TODO: 5.0 Remove param.vendorExtensions.put("x-format-string", "{}"); example = (param.example != null) ? param.example : ""; } } else if (param.isListContainer) { - param.vendorExtensions.put("formatString", "{:?}"); // TODO: 5.0 Remove param.vendorExtensions.put("x-format-string", "{:?}"); example = (param.example != null) ? param.example : "&Vec::new()"; } else { - param.vendorExtensions.put("formatString", "{:?}"); // TODO: 5.0 Remove param.vendorExtensions.put("x-format-string", "{:?}"); if (param.example != null) { example = "serde_json::from_str::<" + param.dataType + ">(r#\"" + param.example + "\"#).expect(\"Failed to parse JSON example\")"; @@ -1658,30 +1600,22 @@ private void processParam(CodegenParameter param, CodegenOperation op) { if (param.required) { if (example != null) { - param.vendorExtensions.put("example", example); // TODO: 5.0 Remove param.vendorExtensions.put("x-example", example); } else if (param.isListContainer) { // Use the empty list if we don't have an example - param.vendorExtensions.put("example", "&Vec::new()"); // TODO: 5.0 Remove param.vendorExtensions.put("x-example", "&Vec::new()"); } else { // If we don't have an example that we can provide, we need to disable the client example, as it won't build. - param.vendorExtensions.put("example", "???"); // TODO: 5.0 Remove param.vendorExtensions.put("x-example", "???"); - op.vendorExtensions.put("noClientExample", Boolean.TRUE); // TODO: 5.0 Remove op.vendorExtensions.put("x-no-client-example", Boolean.TRUE); } } else if ((param.dataFormat != null) && ((param.dataFormat.equals("date-time")) || (param.dataFormat.equals("date")))) { - param.vendorExtensions.put("formatString", "{:?}"); // TODO: 5.0 Remove param.vendorExtensions.put("x-format-string", "{:?}"); - param.vendorExtensions.put("example", "None"); // TODO: 5.0 Remove param.vendorExtensions.put("x-example", "None"); } else { // Not required, so override the format string and example - param.vendorExtensions.put("formatString", "{:?}"); // TODO: 5.0 Remove param.vendorExtensions.put("x-format-string", "{:?}"); String exampleString = (example != null) ? "Some(" + example + ")" : "None"; - param.vendorExtensions.put("example", exampleString); // TODO: 5.0 Remove param.vendorExtensions.put("x-example", exampleString); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java index 50e4ffc684e7..70a3258b4ccd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaFinchServerCodegen.java @@ -240,9 +240,9 @@ public Map postProcessOperationsWithModels(Map o // Converts GET /foo/bar => get("foo" :: "bar") generateScalaPath(op); - // Generates e.g. uuid :: header("boo") :: params("baa") under key "x-codegen-pathParams" - // Generates e.g. (id: UUID, headerBoo: String, paramBaa: String) under key "x-codegen-typedInputParams" - // Generates e.g. (id, headerBoo, paramBaa) under key "x-codegen-inputParams" + // Generates e.g. uuid :: header("boo") :: params("baa") under key "x-codegen-path-params" + // Generates e.g. (id: UUID, headerBoo: String, paramBaa: String) under key "x-codegen-typed-input-params" + // Generates e.g. (id, headerBoo, paramBaa) under key "x-codegen-input-params" generateInputParameters(op); //Generate Auth parameters using security: definition @@ -346,9 +346,6 @@ private void authParameters(CodegenOperation op) { String authInputParams = ""; String typedAuthInputParams = ""; - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - //Append apikey security to path params and create input parameters for functions if (op.authMethods != null) { @@ -365,10 +362,6 @@ private void authParameters(CodegenOperation op) { } } - op.vendorExtensions.put("x-codegen-authParams", authParams); // TODO: 5.0 Remove - op.vendorExtensions.put("x-codegen-authInputParams", authInputParams); // TODO: 5.0 Remove - op.vendorExtensions.put("x-codegen-typedAuthInputParams", typedAuthInputParams); // TODO: 5.0 Remove - op.vendorExtensions.put("x-codegen-auth-params", authParams); op.vendorExtensions.put("x-codegen-auth-input-params", authInputParams); op.vendorExtensions.put("x-codegen-typed-auth-input-params", typedAuthInputParams); @@ -414,18 +407,13 @@ private void generateScalaPath(CodegenOperation op) { private void concatParameters(CodegenOperation op) { - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - - String path = colConcat(colConcat(op.vendorExtensions.get("x-codegen-path").toString(), op.vendorExtensions.get("x-codegen-pathParams").toString()), op.vendorExtensions.get("x-codegen-authParams").toString()); - String parameters = csvConcat(op.vendorExtensions.get("x-codegen-inputParams").toString(), op.vendorExtensions.get("x-codegen-authInputParams").toString()); - String typedParameters = csvConcat(op.vendorExtensions.get("x-codegen-typedInputParams").toString(), op.vendorExtensions.get("x-codegen-typedAuthInputParams").toString()); + String path = colConcat(colConcat(op.vendorExtensions.get("x-codegen-path").toString(), op.vendorExtensions.get("x-codegen-path-params").toString()), op.vendorExtensions.get("x-codegen-auth-params").toString()); + String parameters = csvConcat(op.vendorExtensions.get("x-codegen-input-params").toString(), op.vendorExtensions.get("x-codegen-auth-input-params").toString()); + String typedParameters = csvConcat(op.vendorExtensions.get("x-codegen-typed-input-params").toString(), op.vendorExtensions.get("x-codegen-typed-auth-input-params").toString()); // The input parameters for functions op.vendorExtensions.put("x-codegen-paths", path); op.vendorExtensions.put("x-codegen-params", parameters); - op.vendorExtensions.put("x-codegen-typedParams", typedParameters); // TODO: 5.0 Remove op.vendorExtensions.put("x-codegen-typed-params", typedParameters); } @@ -433,9 +421,6 @@ private void concatParameters(CodegenOperation op) { private void generateInputParameters(CodegenOperation op) { - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - String inputParams = ""; String typedInputParams = ""; String pathParams = ""; @@ -482,13 +467,10 @@ private void generateInputParameters(CodegenOperation op) { } // All body, path, query and header parameters - op.vendorExtensions.put("x-codegen-pathParams", pathParams); // TODO: 5.0 Remove op.vendorExtensions.put("x-codegen-path-params", pathParams); // The input parameters for functions - op.vendorExtensions.put("x-codegen-inputParams", inputParams); // TODO: 5.0 Remove op.vendorExtensions.put("x-codegen-input-params", inputParams); - op.vendorExtensions.put("x-codegen-typedInputParams", typedInputParams); // TODO: 5.0 Remove op.vendorExtensions.put("x-codegen-typed-input-params", typedInputParams); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java index 18ad995d1f59..59037d183dfb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaPlayFrameworkServerCodegen.java @@ -258,9 +258,6 @@ public Map postProcessAllModels(Map objs) { objs = super.postProcessAllModels(objs); Map modelsByClassName = new HashMap<>(); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (Object _outer : objs.values()) { Map outer = (Map) _outer; List> models = (List>) outer.get("models"); @@ -271,7 +268,6 @@ public Map postProcessAllModels(Map objs) { cm.classVarName = camelize(cm.classVarName, true); modelsByClassName.put(cm.classname, cm); boolean hasFiles = cm.vars.stream().anyMatch(var -> var.isFile); - cm.vendorExtensions.put("hasFiles", hasFiles); // TODO: 5.0 Remove cm.vendorExtensions.put("x-has-files", hasFiles); } } @@ -289,9 +285,6 @@ public Map postProcessSupportingFileData(Map obj objs = super.postProcessSupportingFileData(objs); generateJSONSpecFile(objs); - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - // Prettify routes file Map apiInfo = (Map) objs.get("apiInfo"); List> apis = (List>) apiInfo.get("apis"); @@ -304,11 +297,9 @@ public Map postProcessSupportingFileData(Map obj .reduce(0, Integer::max); ops.forEach(op -> { String paddedPath = rightPad(op.path, maxPathLength - op.httpMethod.length()); - op.vendorExtensions.put("paddedPath", paddedPath); // TODO: 5.0 Remove op.vendorExtensions.put("x-padded-path", paddedPath); }); ops.forEach(op -> { - op.vendorExtensions.put("hasPathParams", op.getHasPathParams()); // TODO: 5.0 Remove op.vendorExtensions.put("x-has-path-params", op.getHasPathParams()); }); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java index a0aaec724861..055b29417dac 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/StaticHtml2Generator.java @@ -202,10 +202,6 @@ public void preprocessOpenAPI(OpenAPI openAPI) { @Override public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - if (op.returnType != null) { op.returnType = normalizeType(op.returnType); } @@ -214,7 +210,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation op.path = sanitizePath(op.path); String methodUpperCase = httpMethod.toUpperCase(Locale.ROOT); - op.vendorExtensions.put("x-codegen-httpMethodUpperCase", methodUpperCase); // TODO: 5.0 Remove op.vendorExtensions.put("x-codegen-http-method-upper-case", methodUpperCase); return op; @@ -248,9 +243,6 @@ private void preparHtmlForGlobalDescription(OpenAPI openAPI) { public List postProcessParameterEnum(List parameterList) { String enumFormatted = ""; - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - for (CodegenParameter parameter : parameterList) { if (parameter.isEnum) { for (int i = 0; i < parameter._enum.size(); i++) { @@ -262,7 +254,6 @@ public List postProcessParameterEnum(List pa Markdown markInstance = new Markdown(); if (!enumFormatted.isEmpty()) { String formattedExtension = markInstance.toHtml(enumFormatted); - parameter.vendorExtensions.put("x-eumFormatted", formattedExtension); // TODO: 5.0 Remove parameter.vendorExtensions.put("x-eum-formatted", formattedExtension); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java index ec5ddb557fde..7a740ab76e00 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java @@ -249,11 +249,7 @@ private void updateOperationParameterEnumInformation(Map operati private void setParamNameAlternative(CodegenParameter param, String paramName, String paramNameAlternative) { - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - if (param.paramName.equals(paramName)) { - param.vendorExtensions.put("paramNameAlternative", paramNameAlternative); // TODO: 5.0 Remove param.vendorExtensions.put("x-param-name-alternative", paramNameAlternative); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java index 3ba31200598c..c0dc9e685063 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalData.java @@ -103,18 +103,13 @@ public void addFromInterfaceModel(CodegenModel cm, List> mod * @param implImports imports of the implementing model * @param addInterfaceImports whether or not to add the interface model as import (will vary by language) */ + @SuppressWarnings("unchecked") public void addToImplementor(CodegenConfig cc, CodegenModel implcm, List> implImports, boolean addInterfaceImports) { - - // TODO: 5.0: Remove the camelCased vendorExtension below and ensure templates use the newer property naming. - once(LOGGER).warn("4.3.0 has deprecated the use of vendor extensions which don't follow lower-kebab casing standards with x- prefix."); - - - implcm.getVendorExtensions().putIfAbsent("implements", new ArrayList()); // TODO: 5.0 Remove - implcm.getVendorExtensions().putIfAbsent("x-implements", implcm.getVendorExtensions().get("implements")); + implcm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList()); // Add implemented interfaces for (String intf : additionalInterfaces) { - List impl = (List) implcm.getVendorExtensions().get("implements"); + List impl = (List) implcm.getVendorExtensions().get("x-implements"); impl.add(intf); if (addInterfaceImports) { // Add imports for interfaces diff --git a/modules/openapi-generator/src/main/resources/apex/model_test.mustache b/modules/openapi-generator/src/main/resources/apex/model_test.mustache index 3aef0d655725..b3a49b28b505 100644 --- a/modules/openapi-generator/src/main/resources/apex/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/apex/model_test.mustache @@ -86,18 +86,18 @@ private class {{classname}}Test { System.assertEquals({{classVarName}}3.hashCode(), {{classVarName}}4.hashCode()); } {{#vendorExtensions}} - {{#hasPropertyMappings}} + {{#x-has-property-mappings}} @isTest private static void maintainRenamedProperties() { {{classname}} {{classVarName}} = new {{classname}}(); - Map propertyMappings = {{classVarName}}.getPropertyMappings(); - {{#propertyMappings}} - System.assertEquals('{{internalName}}', propertyMappings.get('{{externalName}}')); - {{/propertyMappings}} + Map x-property-mappings = {{classVarName}}.getx-property-mappings(); + {{#x-property-mappings}} + System.assertEquals('{{internalName}}', x-property-mappings.get('{{externalName}}')); + {{/x-property-mappings}} } - {{/hasPropertyMappings}} - {{#hasDefaultValues}} + {{/x-has-property-mappings}} + {{#x-has-default-values}} @isTest private static void defaultValuesPopulated() { @@ -113,7 +113,7 @@ private class {{classname}}Test { {{/defaultValue}} {{/vars}} } - {{/hasDefaultValues}} + {{/x-has-default-values}} {{/vendorExtensions}} {{/isEnum}} } diff --git a/modules/openapi-generator/src/main/resources/apex/pojo.mustache b/modules/openapi-generator/src/main/resources/apex/pojo.mustache index 9f192178eeac..74f64634440b 100644 --- a/modules/openapi-generator/src/main/resources/apex/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/apex/pojo.mustache @@ -34,19 +34,19 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{#interfac {{/vars}} {{#vendorExtensions}} - {{#hasPropertyMappings}} + {{#x-property-mappings}} private static final Map propertyMappings = new Map{ - {{#propertyMappings}} + {{#x-property-mappings}} '{{externalName}}' => '{{internalName}}'{{^-last}},{{/-last}} - {{/propertyMappings}} + {{/x-property-mappings}} }; public Map getPropertyMappings() { return propertyMappings; } - {{/hasPropertyMappings}} - {{#hasDefaultValues}} + {{/x-property-mappings}} + {{#x-has-default-values}} public {{classname}}() { {{#vars}} {{#defaultValue}} @@ -55,7 +55,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{#interfac {{/vars}} } - {{/hasDefaultValues}} + {{/x-has-default-values}} {{/vendorExtensions}} public static {{classname}} getExample() { {{classname}} {{classVarName}} = new {{classname}}(); diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache index 4d1a4c5931cd..339e22af3c9d 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache @@ -40,11 +40,11 @@ class {{classname}} extends ApiClient with _${{classname}}Client { {{#vendorExtensions}} {{#formParams}} {{#-first}}{{#hasQueryParams}},{{/hasQueryParams}}{{^hasQueryParams}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{/hasQueryParams}}{{^hasQueryParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/hasQueryParams}}{{/-first}} - {{#isJson}}@AsJson() {{/isJson}}{{#isForm}}@AsFormField() {{/isForm}}{{#isMultipart}}@AsMultipartField() {{/isMultipart}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}} + {{#x-is-json}}@AsJson() {{/x-is-json}}{{#x-is-form}}@AsFormField() {{/x-is-form}}{{#x-is-multipart}}@AsMultipartField() {{/x-is-multipart}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}} {{/formParams}} {{#bodyParam}} {{#hasFormParams}},{{/hasFormParams}}{{^hasFormParams}}{{#hasQueryParams}},{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}} - {{^isProto}}{{^isJson}}{{^isForm}}{{^isMultipart}}@AsBody(){{/isMultipart}}{{/isForm}}{{/isJson}}{{/isProto}} {{#isProto}}@Serialized(MimeTypes.binary) {{/isProto}}{{#isJson}}@AsJson() {{/isJson}}{{#isForm}}@AsForm() {{/isForm}}{{#isMultipart}}@AsMultipart() {{/isMultipart}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}} + {{^x-is-proto}}{{^x-is-json}}{{^x-is-form}}{{^x-is-multipart}}@AsBody(){{/x-is-multipart}}{{/x-is-form}}{{/x-is-json}}{{/x-is-proto}} {{#x-is-proto}}@Serialized(MimeTypes.binary) {{/x-is-proto}}{{#x-is-json}}@AsJson() {{/x-is-json}}{{#x-is-form}}@AsForm() {{/x-is-form}}{{#x-is-multipart}}@AsMultipart() {{/x-is-multipart}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}} {{/bodyParam}} {{/vendorExtensions}} ) { diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache index 0ee26193bba5..5a5edb919999 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache @@ -22,10 +22,10 @@ class {{classname}} { {{classname}}( {{#vars}}{{^defaultValue}}{{#required}} this.{{name}}, {{/required}}{{/defaultValue}}{{/vars}} -{{#vendorExtensions}}{{#hasVars}}{ +{{#vendorExtensions}}{{#x-has-vars}}{ {{#vars}}{{^required}} this.{{name}}{{#defaultValue}} = {{{defaultValue}}}{{#hasMore}}, {{/hasMore}} {{/defaultValue}}{{/required}} {{#required}} {{#defaultValue}}this.{{name}} = {{{defaultValue}}}{{#hasMore}}, {{/hasMore}} {{/defaultValue}}{{/required}}{{/vars}} - }{{/hasVars}}{{/vendorExtensions}} + }{{/x-has-vars}}{{/vendorExtensions}} ); @override diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/MimeTypes.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/MimeTypes.mustache index c1c83ec7120d..b9bdd3e27335 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/MimeTypes.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/MimeTypes.mustache @@ -195,7 +195,7 @@ instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P {{#x-hasUnknownMimeTypes}} -- * Custom Mime Types -{{#x-unknownMimeTypes}}-- ** {{{x-mediaDataType}}} +{{#x-unknown-mime-types}}-- ** {{{x-mediaDataType}}} data {{{x-mediaDataType}}} = {{{x-mediaDataType}}} deriving (P.Typeable) @@ -207,4 +207,4 @@ instance A.FromJSON a => MimeUnrender {{{x-mediaDataType}}} a where mimeUnrender -- instance MimeRender {{{x-mediaDataType}}} T.Text where mimeRender _ = undefined -- instance MimeUnrender {{{x-mediaDataType}}} T.Text where mimeUnrender _ = undefined -{{/x-unknownMimeTypes}}{{/x-hasUnknownMimeTypes}} \ No newline at end of file +{{/x-unknown-mime-types}}{{/x-hasUnknownMimeTypes}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache index d8dd9f0f2489..c42a4ee01ff9 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache @@ -58,8 +58,8 @@ import qualified Prelude as P -- * Parameter newtypes {{#x-allUniqueParams}}{{#x-newtype}} --- ** {{{x-paramNameType}}} -newtype {{{x-paramNameType}}} = {{{x-paramNameType}}} { un{{{x-paramNameType}}} :: {{{x-dataType}}} } deriving (P.Eq, P.Show{{#x-isBodyParam}}, A.ToJSON{{/x-isBodyParam}}){{/x-newtype}}{{/x-allUniqueParams}} +-- ** {{{x-param-name-type}}} +newtype {{{x-param-name-type}}} = {{{x-param-name-type}}} { un{{{x-param-name-type}}} :: {{{x-data-type}}} } deriving (P.Eq, P.Show{{#x-isBodyParam}}, A.ToJSON{{/x-isBodyParam}}){{/x-newtype}}{{/x-allUniqueParams}} -- * Models @@ -125,30 +125,30 @@ mk{{classname}} {{#vars}}{{#required}}{{name}} {{/required}}{{/vars}}= {{#x-hasEnumSection}}-- * Enums {{#x-allUniqueParams}}{{#x-enum}} --- ** {{{x-paramNameType}}} +-- ** {{{x-param-name-type}}} --- | Enum of '{{{x-dataType}}}'{{#description}} . +-- | Enum of '{{{x-data-type}}}'{{#description}} . -- {{{.}}}{{/description}} -data {{{x-paramNameType}}} +data {{{x-param-name-type}}} = {{#allowableValues}}{{#enumVars}}{{{name}}} -- ^ @{{{value}}}@ {{^-last}}| {{/-last}}{{#-last}}deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum){{/-last}}{{/enumVars}}{{/allowableValues}} -instance A.ToJSON {{{x-paramNameType}}} where toJSON = A.toJSON . from{{{x-paramNameType}}} -instance A.FromJSON {{{x-paramNameType}}} where parseJSON o = P.either P.fail (pure . P.id) . to{{{x-paramNameType}}} =<< A.parseJSON o -instance WH.ToHttpApiData {{{x-paramNameType}}} where toQueryParam = WH.toQueryParam . from{{{x-paramNameType}}} -instance WH.FromHttpApiData {{{x-paramNameType}}} where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . to{{{x-paramNameType}}} -instance MimeRender MimeMultipartFormData {{{x-paramNameType}}} where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.ToJSON {{{x-param-name-type}}} where toJSON = A.toJSON . from{{{x-param-name-type}}} +instance A.FromJSON {{{x-param-name-type}}} where parseJSON o = P.either P.fail (pure . P.id) . to{{{x-param-name-type}}} =<< A.parseJSON o +instance WH.ToHttpApiData {{{x-param-name-type}}} where toQueryParam = WH.toQueryParam . from{{{x-param-name-type}}} +instance WH.FromHttpApiData {{{x-param-name-type}}} where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . to{{{x-param-name-type}}} +instance MimeRender MimeMultipartFormData {{{x-param-name-type}}} where mimeRender _ = mimeRenderDefaultMultipartFormData --- | unwrap '{{{x-paramNameType}}}' enum -from{{{x-paramNameType}}} :: {{{x-paramNameType}}} -> {{{x-dataType}}} -from{{{x-paramNameType}}} = \case{{#allowableValues}}{{#enumVars}} +-- | unwrap '{{{x-param-name-type}}}' enum +from{{{x-param-name-type}}} :: {{{x-param-name-type}}} -> {{{x-data-type}}} +from{{{x-param-name-type}}} = \case{{#allowableValues}}{{#enumVars}} {{{name}}} -> {{{value}}}{{/enumVars}}{{/allowableValues}} --- | parse '{{{x-paramNameType}}}' enum -to{{{x-paramNameType}}} :: {{{x-dataType}}} -> P.Either String {{{x-paramNameType}}} -to{{{x-paramNameType}}} = \case{{#allowableValues}}{{#enumVars}} +-- | parse '{{{x-param-name-type}}}' enum +to{{{x-param-name-type}}} :: {{{x-data-type}}} -> P.Either String {{{x-param-name-type}}} +to{{{x-param-name-type}}} = \case{{#allowableValues}}{{#enumVars}} {{{value}}} -> P.Right {{{name}}}{{/enumVars}}{{/allowableValues}} - s -> P.Left $ "to{{{x-paramNameType}}}: enum parse failure: " P.++ P.show s + s -> P.Left $ "to{{{x-param-name-type}}}: enum parse failure: " P.++ P.show s {{/x-enum}}{{/x-allUniqueParams}}{{/x-hasEnumSection}} {{#authMethods}}{{#-first}}-- * Auth Methods diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache index a684c08db710..a3232a07daa8 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache @@ -123,6 +123,6 @@ gen{{classname}} n = {{#x-allUniqueParams}}{{#x-enum}} -instance Arbitrary {{{x-paramNameType}}} where +instance Arbitrary {{{x-param-name-type}}} where arbitrary = arbitraryBoundedEnum {{/x-enum}}{{/x-allUniqueParams}} diff --git a/modules/openapi-generator/src/main/resources/mysql-schema/mysql_schema.mustache b/modules/openapi-generator/src/main/resources/mysql-schema/mysql_schema.mustache index 9ccdef756432..e54dc6daf336 100644 --- a/modules/openapi-generator/src/main/resources/mysql-schema/mysql_schema.mustache +++ b/modules/openapi-generator/src/main/resources/mysql-schema/mysql_schema.mustache @@ -12,34 +12,34 @@ CREATE DATABASE IF NOT EXISTS `{{{defaultDatabaseName}}}` DEFAULT CHARACTER SET -- -------------------------------------------------------- {{#models}}{{#model}}{{#hasVars}}{{^isArrayModel}}-- --- Table structure{{#vendorExtensions}}{{#x-mysqlSchema}}{{#tableDefinition}} for table `{{tblName}}`{{/tableDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}} generated from model '{{classVarName}}' +-- Table structure{{#vendorExtensions}}{{#x-mysql-schema}}{{#tableDefinition}} for table `{{tblName}}`{{/tableDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}} generated from model '{{classVarName}}' {{#description}} -- {{description}} {{/description}} -- {{#vendorExtensions}} -{{#x-mysqlSchema}} +{{#x-mysql-schema}} {{#tableDefinition}} CREATE TABLE IF NOT EXISTS {{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{{/defaultDatabaseName}}`{{tblName}}` ( {{/tableDefinition}} -{{/x-mysqlSchema}} +{{/x-mysql-schema}} {{/vendorExtensions}} {{#vars}} {{#vendorExtensions}} - {{#x-mysqlSchema}} + {{#x-mysql-schema}} {{#columnDefinition}} `{{colName}}` {{colDataType}}{{#colDataTypeArguments}}{{#-first}}({{/-first}}{{#isString}}'{{/isString}}{{argumentValue}}{{#isString}}'{{/isString}}{{^-last}}, {{/-last}}{{#-last}}){{/-last}}{{/colDataTypeArguments}}{{#colUnsigned}} UNSIGNED{{/colUnsigned}}{{#colNotNull}} NOT NULL{{/colNotNull}}{{#colDefault}} DEFAULT {{#isString}}'{{defaultValue}}'{{/isString}}{{^isString}}{{defaultValue}}{{/isString}}{{/colDefault}}{{#colComment}} COMMENT '{{colComment}}'{{/colComment}}{{^-last}},{{/-last}} {{/columnDefinition}} - {{/x-mysqlSchema}} + {{/x-mysql-schema}} {{/vendorExtensions}} {{/vars}} {{#vendorExtensions}} -{{#x-mysqlSchema}} +{{#x-mysql-schema}} {{#tableDefinition}} ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci{{#tblComment}} COMMENT='{{tblComment}}'{{/tblComment}}; {{/tableDefinition}} -{{/x-mysqlSchema}} +{{/x-mysql-schema}} {{/vendorExtensions}} {{/isArrayModel}}{{/hasVars}}{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/mysql-schema/sql_query.mustache b/modules/openapi-generator/src/main/resources/mysql-schema/sql_query.mustache index 888ecb3e8a7d..7775e7c70d30 100644 --- a/modules/openapi-generator/src/main/resources/mysql-schema/sql_query.mustache +++ b/modules/openapi-generator/src/main/resources/mysql-schema/sql_query.mustache @@ -6,22 +6,22 @@ {{#models}}{{#model}} -- --- SELECT template for table {{#vendorExtensions}}{{#x-mysqlSchema}}{{#tableDefinition}}`{{tblName}}`{{/tableDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}} +-- SELECT template for table {{#vendorExtensions}}{{#x-mysql-schema}}{{#tableDefinition}}`{{tblName}}`{{/tableDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}} -- -SELECT {{#vars}}{{#vendorExtensions}}{{#x-mysqlSchema}}{{#columnDefinition}}`{{colName}}`{{#hasMore}}, {{/hasMore}}{{/columnDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}}{{/vars}} FROM {{#vendorExtensions}}{{#x-mysqlSchema}}{{#tableDefinition}}{{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{{/defaultDatabaseName}}`{{tblName}}`{{/tableDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}} WHERE 1; +SELECT {{#vars}}{{#vendorExtensions}}{{#x-mysql-schema}}{{#columnDefinition}}`{{colName}}`{{#hasMore}}, {{/hasMore}}{{/columnDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}}{{/vars}} FROM {{#vendorExtensions}}{{#x-mysql-schema}}{{#tableDefinition}}{{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{{/defaultDatabaseName}}`{{tblName}}`{{/tableDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}} WHERE 1; -- --- INSERT template for table {{#vendorExtensions}}{{#x-mysqlSchema}}{{#tableDefinition}}`{{tblName}}`{{/tableDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}} +-- INSERT template for table {{#vendorExtensions}}{{#x-mysql-schema}}{{#tableDefinition}}`{{tblName}}`{{/tableDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}} -- -INSERT INTO {{#vendorExtensions}}{{#x-mysqlSchema}}{{#tableDefinition}}{{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{{/defaultDatabaseName}}`{{tblName}}`{{/tableDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}}({{#vars}}{{#vendorExtensions}}{{#x-mysqlSchema}}{{#columnDefinition}}`{{colName}}`{{#hasMore}}, {{/hasMore}}{{/columnDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}}{{/vars}}) VALUES ({{#vars}}{{#vendorExtensions}}{{#x-mysqlSchema}}{{#columnDefinition}}{{#namedParametersEnabled}}:{{colName}}{{/namedParametersEnabled}}{{^namedParametersEnabled}}?{{/namedParametersEnabled}}{{#hasMore}}, {{/hasMore}}{{/columnDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}}{{/vars}}); +INSERT INTO {{#vendorExtensions}}{{#x-mysql-schema}}{{#tableDefinition}}{{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{{/defaultDatabaseName}}`{{tblName}}`{{/tableDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}}({{#vars}}{{#vendorExtensions}}{{#x-mysql-schema}}{{#columnDefinition}}`{{colName}}`{{#hasMore}}, {{/hasMore}}{{/columnDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}}{{/vars}}) VALUES ({{#vars}}{{#vendorExtensions}}{{#x-mysql-schema}}{{#columnDefinition}}{{#namedParametersEnabled}}:{{colName}}{{/namedParametersEnabled}}{{^namedParametersEnabled}}?{{/namedParametersEnabled}}{{#hasMore}}, {{/hasMore}}{{/columnDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}}{{/vars}}); -- --- UPDATE template for table {{#vendorExtensions}}{{#x-mysqlSchema}}{{#tableDefinition}}`{{tblName}}`{{/tableDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}} +-- UPDATE template for table {{#vendorExtensions}}{{#x-mysql-schema}}{{#tableDefinition}}`{{tblName}}`{{/tableDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}} -- -UPDATE {{#vendorExtensions}}{{#x-mysqlSchema}}{{#tableDefinition}}{{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{{/defaultDatabaseName}}`{{tblName}}`{{/tableDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}} SET {{#vars}}{{#vendorExtensions}}{{#x-mysqlSchema}}{{#columnDefinition}}`{{colName}}` = {{#namedParametersEnabled}}:{{colName}}{{/namedParametersEnabled}}{{^namedParametersEnabled}}?{{/namedParametersEnabled}}{{#hasMore}}, {{/hasMore}}{{/columnDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}}{{/vars}} WHERE 1; +UPDATE {{#vendorExtensions}}{{#x-mysql-schema}}{{#tableDefinition}}{{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{{/defaultDatabaseName}}`{{tblName}}`{{/tableDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}} SET {{#vars}}{{#vendorExtensions}}{{#x-mysql-schema}}{{#columnDefinition}}`{{colName}}` = {{#namedParametersEnabled}}:{{colName}}{{/namedParametersEnabled}}{{^namedParametersEnabled}}?{{/namedParametersEnabled}}{{#hasMore}}, {{/hasMore}}{{/columnDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}}{{/vars}} WHERE 1; -- --- DELETE template for table {{#vendorExtensions}}{{#x-mysqlSchema}}{{#tableDefinition}}`{{tblName}}`{{/tableDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}} +-- DELETE template for table {{#vendorExtensions}}{{#x-mysql-schema}}{{#tableDefinition}}`{{tblName}}`{{/tableDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}} -- -DELETE FROM {{#vendorExtensions}}{{#x-mysqlSchema}}{{#tableDefinition}}{{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{{/defaultDatabaseName}}`{{tblName}}`{{/tableDefinition}}{{/x-mysqlSchema}}{{/vendorExtensions}} WHERE 0; +DELETE FROM {{#vendorExtensions}}{{#x-mysql-schema}}{{#tableDefinition}}{{#defaultDatabaseName}}`{{{defaultDatabaseName}}}`.{{/defaultDatabaseName}}`{{tblName}}`{{/tableDefinition}}{{/x-mysql-schema}}{{/vendorExtensions}} WHERE 0; {{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/ocaml/of_json.mustache b/modules/openapi-generator/src/main/resources/ocaml/of_json.mustache index a7be3d4d7ca5..be01eeafa4c4 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/of_json.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/of_json.mustache @@ -1 +1 @@ -{{#isEnum}}JsonSupport.unwrap Enums.{{{datatypeWithEnum}}}_of_yojson{{/isEnum}}{{^isEnum}}{{#returnType}}{{#returnTypeIsPrimitive}}JsonSupport.to_{{{returnBaseType}}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#vendorExtensions.x-modelModule}}JsonSupport.unwrap {{{vendorExtensions.x-modelModule}}}.of_yojson{{/vendorExtensions.x-modelModule}}{{^vendorExtensions.x-modelModule}}JsonSupport.unwrap {{{returnBaseType}}}.of_yojson{{/vendorExtensions.x-modelModule}}{{/returnTypeIsPrimitive}}{{/returnType}}{{/isEnum}} \ No newline at end of file +{{#isEnum}}JsonSupport.unwrap Enums.{{{datatypeWithEnum}}}_of_yojson{{/isEnum}}{{^isEnum}}{{#returnType}}{{#returnTypeIsPrimitive}}JsonSupport.to_{{{returnBaseType}}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#vendorExtensions.x-model-module}}JsonSupport.unwrap {{{vendorExtensions.x-model-module}}}.of_yojson{{/vendorExtensions.x-model-module}}{{^vendorExtensions.x-model-module}}JsonSupport.unwrap {{{returnBaseType}}}.of_yojson{{/vendorExtensions.x-model-module}}{{/returnTypeIsPrimitive}}{{/returnType}}{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml/to_json.mustache b/modules/openapi-generator/src/main/resources/ocaml/to_json.mustache index 6b8fea90fdcd..a0fa3504a7aa 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/to_json.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/to_json.mustache @@ -1 +1 @@ -{{#isListContainer}}{{#items}}(JsonSupport.of_list_of {{> to_json}}){{/items}}{{/isListContainer}}{{#isMapContainer}}{{#items}}(JsonSupport.of_map_of {{> to_json}}){{/items}}{{/isMapContainer}}{{#isString}}JsonSupport.of_string{{/isString}}{{#isLong}}JsonSupport.of_int64{{/isLong}}{{#isInteger}}JsonSupport.of_int32{{/isInteger}}{{#isFloat}}JsonSupport.of_float{{/isFloat}}{{#isNumber}}JsonSupport.of_float{{/isNumber}}{{#isDouble}}JsonSupport.of_float{{/isDouble}}{{#isBoolean}}JsonSupport.of_bool{{/isBoolean}}{{^isEnum}}{{#isModel}}{{#vendorExtensions.x-modelModule}}{{{vendorExtensions.x-modelModule}}}.to_yojson{{/vendorExtensions.x-modelModule}}{{^vendorExtensions.x-modelModule}}{{{baseType}}}.to_yojson{{/vendorExtensions.x-modelModule}}{{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.{{{datatypeWithEnum}}}_to_yojson{{/isEnum}}{{/isContainer}}{{/isModel}} \ No newline at end of file +{{#isListContainer}}{{#items}}(JsonSupport.of_list_of {{> to_json}}){{/items}}{{/isListContainer}}{{#isMapContainer}}{{#items}}(JsonSupport.of_map_of {{> to_json}}){{/items}}{{/isMapContainer}}{{#isString}}JsonSupport.of_string{{/isString}}{{#isLong}}JsonSupport.of_int64{{/isLong}}{{#isInteger}}JsonSupport.of_int32{{/isInteger}}{{#isFloat}}JsonSupport.of_float{{/isFloat}}{{#isNumber}}JsonSupport.of_float{{/isNumber}}{{#isDouble}}JsonSupport.of_float{{/isDouble}}{{#isBoolean}}JsonSupport.of_bool{{/isBoolean}}{{^isEnum}}{{#isModel}}{{#vendorExtensions.x-model-module}}{{{vendorExtensions.x-model-module}}}.to_yojson{{/vendorExtensions.x-model-module}}{{^vendorExtensions.x-model-module}}{{{baseType}}}.to_yojson{{/vendorExtensions.x-model-module}}{{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.{{{datatypeWithEnum}}}_to_yojson{{/isEnum}}{{/isContainer}}{{/isModel}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache b/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache index 0588ac5ab4f8..3b41569d43d9 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache @@ -1 +1 @@ -{{#isContainer}}{{#items}}(List.map {{> to_string}}){{/items}}{{/isContainer}}{{^isEnum}}{{#isLong}}Int64.to_string{{/isLong}}{{#isInteger}}Int32.to_string{{/isInteger}}{{#isFloat}}string_of_float{{/isFloat}}{{#isNumber}}string_of_float{{/isNumber}}{{#isDouble}}string_of_float{{/isDouble}}{{#isBoolean}}string_of_bool{{/isBoolean}}{{#isFile}}(fun x -> x){{/isFile}}{{#isDate}}(fun x -> x){{/isDate}}{{#isDateTime}}(fun x -> x){{/isDateTime}}{{#isString}}(fun x -> x){{/isString}}{{#isByteArray}}(fun x -> x){{/isByteArray}}{{#isModel}}{{{vendorExtensions.x-modelModule}}}.show{{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.show_{{{datatypeWithEnum}}}{{/isEnum}}{{/isContainer}}{{/isModel}} \ No newline at end of file +{{#isContainer}}{{#items}}(List.map {{> to_string}}){{/items}}{{/isContainer}}{{^isEnum}}{{#isLong}}Int64.to_string{{/isLong}}{{#isInteger}}Int32.to_string{{/isInteger}}{{#isFloat}}string_of_float{{/isFloat}}{{#isNumber}}string_of_float{{/isNumber}}{{#isDouble}}string_of_float{{/isDouble}}{{#isBoolean}}string_of_bool{{/isBoolean}}{{#isFile}}(fun x -> x){{/isFile}}{{#isDate}}(fun x -> x){{/isDate}}{{#isDateTime}}(fun x -> x){{/isDateTime}}{{#isString}}(fun x -> x){{/isString}}{{#isByteArray}}(fun x -> x){{/isByteArray}}{{#isModel}}{{{vendorExtensions.x-model-module}}}.show{{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.show_{{{datatypeWithEnum}}}{{/isEnum}}{{/isContainer}}{{/isModel}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/rust-server/README.mustache b/modules/openapi-generator/src/main/resources/rust-server/README.mustache index f75899a2e493..bb8fe72a7491 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/README.mustache @@ -68,9 +68,9 @@ To run a client, follow one of the following simple steps: {{#operations}} {{#operation}} {{#vendorExtensions}} - {{^noClientExample}} + {{^x-no-client-example}} cargo run --example client {{{operationId}}} - {{/noClientExample}} + {{/x-no-client-example}} {{/vendorExtensions}} {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/client-callbacks.mustache b/modules/openapi-generator/src/main/resources/rust-server/client-callbacks.mustache index 33d3bd68c14a..dbc63930c2d0 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/client-callbacks.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/client-callbacks.mustache @@ -58,7 +58,7 @@ impl RequestParser for ApiRequestParser { {{#urls}} {{#requests}} // {{{operationId}}} - {{{httpMethod}}} {{{path}}} - &hyper::Method::{{{vendorExtensions.HttpMethod}}} if path.matched(paths::ID_{{{vendorExtensions.PATH_ID}}}) => Ok("{{{operationId}}}"), + &hyper::Method::{{{vendorExtensions.x-http-method}}} if path.matched(paths::ID_{{{vendorExtensions.x-path-id}}}) => Ok("{{{operationId}}}"), {{/requests}} {{/urls}} {{/callbacks}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/client-operation.mustache b/modules/openapi-generator/src/main/resources/rust-server/client-operation.mustache index 9db3e8c2c5c6..a027811c122a 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/client-operation.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/client-operation.mustache @@ -1,9 +1,9 @@ - async fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}( + async fn {{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( &self, {{#vendorExtensions}} - {{#callbackParams}} + {{#x-callback-params}} callback_{{.}}: String, - {{/callbackParams}} + {{/x-callback-params}} {{/vendorExtensions}} {{#allParams}} param_{{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}, @@ -23,9 +23,9 @@ ,{{{paramName}}}=utf8_percent_encode(¶m_{{{paramName}}}.to_string(), ID_ENCODE_SET) {{/pathParams}} {{#vendorExtensions}} - {{#callbackParams}} + {{#x-callback-params}} ,{{.}}=callback_{{.}} - {{/callbackParams}} + {{/x-callback-params}} {{/vendorExtensions}} ); @@ -65,7 +65,7 @@ }; let mut request = match Request::builder() - .method("{{{vendorExtensions.HttpMethod}}}") + .method("{{{vendorExtensions.x-http-method}}}") .uri(uri) .body(Body::empty()) { Ok(req) => req, @@ -73,7 +73,7 @@ }; {{#vendorExtensions}} - {{#consumesMultipart}} + {{#x-consumes-multipart}} let (body_string, multipart_header) = { let mut multipart = Multipart::new(); @@ -139,10 +139,10 @@ Err(e) => return Err(ApiError(format!("Unable to create header: {} - {}", multipart_header, e))) }); - {{/consumesMultipart}} - {{^consumesMultipart}} + {{/x-consumes-multipart}} + {{^x-consumes-multipart}} {{#vendorExtensions}} - {{^consumesMultipartRelated}} + {{^x-consumes-multipart-related}} {{#formParams}} {{#-first}} let params = &[ @@ -160,8 +160,8 @@ *request.body_mut() = Body::from(body.into_bytes()); {{/-last}} {{/formParams}} - {{/consumesMultipartRelated}} - {{#consumesMultipartRelated}} + {{/x-consumes-multipart-related}} + {{#x-consumes-multipart-related}} {{#formParams}} {{#-first}} // Construct the Body for a multipart/related request. The mime 0.2.6 library @@ -223,37 +223,37 @@ {{/-last}} {{/formParams}} - {{/consumesMultipartRelated}} + {{/x-consumes-multipart-related}} {{/vendorExtensions}} {{#bodyParam}} {{#-first}} // Body parameter {{/-first}} {{#vendorExtensions}} - {{#consumesPlainText}} + {{#x-consumes-plain-text}} {{#isByteArray}} let body = param_{{{paramName}}}.0; {{/isByteArray}} {{^isByteArray}} let body = param_{{{paramName}}}; {{/isByteArray}} - {{/consumesPlainText}} + {{/x-consumes-plain-text}} {{#required}} - {{#consumesXml}} + {{#x-consumes-xml}} let body = param_{{{paramName}}}.to_xml(); - {{/consumesXml}} - {{#consumesJson}} + {{/x-consumes-xml}} + {{#x-consumes-json}} let body = serde_json::to_string(¶m_{{{paramName}}}).expect("impossible to fail to serialize"); - {{/consumesJson}} + {{/x-consumes-json}} {{/required}} {{^required}} let body = param_{{{paramName}}}.map(|ref body| { - {{#consumesXml}} + {{#x-consumes-xml}} body.to_xml() - {{/consumesXml}} - {{#consumesJson}} + {{/x-consumes-xml}} + {{#x-consumes-json}} serde_json::to_string(body).expect("impossible to fail to serialize") - {{/consumesJson}} + {{/x-consumes-json}} }); {{/required}} {{/vendorExtensions}} @@ -279,7 +279,7 @@ {{/-last}} {{/bodyParam}} -{{/consumesMultipart}} +{{/x-consumes-multipart}} {{/vendorExtensions}} let header = HeaderValue::from_str(Has::::get(context).0.clone().to_string().as_str()); request.headers_mut().insert(HeaderName::from_static("x-span-id"), match header { @@ -393,27 +393,27 @@ .to_raw() .map_err(|e| ApiError(format!("Failed to read response: {}", e))).await?; {{#vendorExtensions}} -{{#producesBytes}} +{{#x-produces-bytes}} let body = swagger::ByteArray(body.to_vec()); -{{/producesBytes}} -{{^producesBytes}} +{{/x-produces-bytes}} +{{^x-produces-bytes}} let body = str::from_utf8(&body) .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; - {{#producesXml}} + {{#x-produces-xml}} // ToDo: this will move to swagger-rs and become a standard From conversion trait // once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream let body = serde_xml_rs::from_str::<{{{dataType}}}>(body) .map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))?; - {{/producesXml}} - {{#producesJson}} + {{/x-produces-xml}} + {{#x-produces-json}} let body = serde_json::from_str::<{{{dataType}}}>(body)?; - {{/producesJson}} - {{#producesPlainText}} + {{/x-produces-json}} + {{#x-produces-plain-text}} let body = body.to_string(); - {{/producesPlainText}} -{{/producesBytes}} + {{/x-produces-plain-text}} +{{/x-produces-bytes}} {{/vendorExtensions}} - Ok({{{operationId}}}Response::{{#vendorExtensions}}{{x-responseId}}{{/vendorExtensions}} + Ok({{{operationId}}}Response::{{#vendorExtensions}}{{x-response-id}}{{/vendorExtensions}} {{^headers}} (body) {{/headers}} @@ -431,7 +431,7 @@ {{/dataType}} {{^dataType}} Ok( - {{{operationId}}}Response::{{#vendorExtensions}}{{x-responseId}}{{/vendorExtensions}} + {{{operationId}}}Response::{{#vendorExtensions}}{{x-response-id}}{{/vendorExtensions}} {{#headers}} {{#-first}} { diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-client-main.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-client-main.mustache index 2463d942f998..b29b387b1e4c 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-client-main.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-client-main.mustache @@ -43,9 +43,9 @@ fn main() { {{#operations}} {{#operation}} {{#vendorExtensions}} - {{^noClientExample}} + {{^x-no-client-example}} "{{{operationId}}}", - {{/noClientExample}} + {{/x-no-client-example}} {{/vendorExtensions}} {{/operation}} {{/operations}} @@ -104,22 +104,22 @@ fn main() { {{#operations}} {{#operation}} {{#vendorExtensions}} - {{#noClientExample}} + {{#x-no-client-example}} /* Disabled because there's no example. - {{/noClientExample}} + {{/x-no-client-example}} {{/vendorExtensions}} Some("{{{operationId}}}") => { - let result = rt.block_on(client.{{{vendorExtensions.operation_id}}}( + let result = rt.block_on(client.{{{vendorExtensions.x-operation-id}}}( {{#allParams}} - {{{vendorExtensions.example}}}{{^-last}},{{/-last}} + {{{vendorExtensions.x-example}}}{{^-last}},{{/-last}} {{/allParams}} )); info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, {{#vendorExtensions}} - {{#noClientExample}} + {{#x-no-client-example}} */ - {{/noClientExample}} + {{/x-no-client-example}} {{/vendorExtensions}} {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-server-operation.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-server-operation.mustache index 5caf982d9121..ea9a9ea16e84 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-server-operation.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-server-operation.mustache @@ -1,12 +1,12 @@ {{#summary}} /// {{{summary}}} {{/summary}} - async fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}( + async fn {{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( &self, {{#vendorExtensions}} - {{#callbackParams}} + {{#x-callback-params}} callback_{{.}}: String, - {{/callbackParams}} + {{/x-callback-params}} {{/vendorExtensions}} {{#allParams}} {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}, @@ -14,6 +14,6 @@ context: &C) -> Result<{{{operationId}}}Response, ApiError> { let context = context.clone(); - info!("{{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}({{#allParams}}{{#vendorExtensions}}{{{formatString}}}{{/vendorExtensions}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) - X-Span-ID: {:?}"{{#allParams}}, {{{paramName}}}{{/allParams}}, context.get().0.clone()); + info!("{{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}({{#allParams}}{{#vendorExtensions}}{{{x-format-string}}}{{/vendorExtensions}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) - X-Span-ID: {:?}"{{#allParams}}, {{{paramName}}}{{/allParams}}, context.get().0.clone()); Err("Generic failuare".into()) } diff --git a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache index 2b5af42776a4..51c94217a6f8 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache @@ -36,7 +36,7 @@ pub trait Api { {{#summary}} /// {{{summary}}} {{/summary}} - async fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}( + async fn {{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( &self, {{#allParams}} {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}, @@ -64,7 +64,7 @@ pub trait ApiNoContext { {{#summary}} /// {{{summary}}} {{/summary}} - async fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}( + async fn {{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( &self, {{#allParams}} {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}, @@ -107,7 +107,7 @@ impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for Contex {{#summary}} /// {{{summary}}} {{/summary}} - async fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}( + async fn {{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( &self, {{#allParams}} {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}, @@ -115,7 +115,7 @@ impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for Contex ) -> Result<{{{operationId}}}Response, ApiError> { let context = self.context().clone(); - self.api().{{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}({{#allParams}}{{{paramName}}}, {{/allParams}}&context).await + self.api().{{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}({{#allParams}}{{{paramName}}}, {{/allParams}}&context).await } {{/operation}} @@ -159,12 +159,12 @@ pub trait CallbackApi { {{#summary}} /// {{{summary}}} {{/summary}} - async fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}( + async fn {{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( &self, {{#vendorExtensions}} - {{#callbackParams}} + {{#x-callback-params}} callback_{{.}}: String, - {{/callbackParams}} + {{/x-callback-params}} {{/vendorExtensions}} {{#allParams}} {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}, @@ -197,12 +197,12 @@ pub trait CallbackApiNoContext { {{#summary}} /// {{{summary}}} {{/summary}} - async fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}( + async fn {{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( &self, {{#vendorExtensions}} - {{#callbackParams}} + {{#x-callback-params}} callback_{{.}}: String, - {{/callbackParams}} + {{/x-callback-params}} {{/vendorExtensions}} {{#allParams}} {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}, @@ -250,12 +250,12 @@ impl + Send + Sync, C: Clone + Send + Sync> CallbackApiNoConte {{#summary}} /// {{{summary}}} {{/summary}} - async fn {{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}( + async fn {{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( &self, {{#vendorExtensions}} - {{#callbackParams}} + {{#x-callback-params}} callback_{{.}}: String, - {{/callbackParams}} + {{/x-callback-params}} {{/vendorExtensions}} {{#allParams}} {{{paramName}}}: {{^required}}Option<{{/required}}{{#isListContainer}}&{{/isListContainer}}{{{dataType}}}{{^required}}>{{/required}}, @@ -263,11 +263,11 @@ impl + Send + Sync, C: Clone + Send + Sync> CallbackApiNoConte ) -> Result<{{{operationId}}}Response, ApiError> { let context = self.context().clone(); - self.api().{{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}( + self.api().{{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( {{#vendorExtensions}} - {{#callbackParams}} + {{#x-callback-params}} callback_{{.}}, - {{/callbackParams}} + {{/x-callback-params}} {{/vendorExtensions}} {{#allParams}} {{{paramName}}}, diff --git a/modules/openapi-generator/src/main/resources/rust-server/models.mustache b/modules/openapi-generator/src/main/resources/rust-server/models.mustache index 58618bef5ff8..63bc8e469c87 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/models.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/models.mustache @@ -159,25 +159,25 @@ impl std::convert::TryFrom for header::IntoHeaderVal } } -{{#arrayModelType}}{{#vendorExtensions}}{{#itemXmlName}}// Utility function for wrapping list elements when serializing xml +{{#arrayModelType}}{{#vendorExtensions}}{{#x-item-xml-name}}// Utility function for wrapping list elements when serializing xml #[allow(non_snake_case)] -fn wrap_in_{{{itemXmlName}}}(item: &Vec<{{{arrayModelType}}}>, serializer: S) -> std::result::Result +fn wrap_in_{{{x-item-xml-name}}}(item: &Vec<{{{arrayModelType}}}>, serializer: S) -> std::result::Result where S: serde::ser::Serializer, { - serde_xml_rs::wrap_primitives(item, serializer, "{{{itemXmlName}}}") + serde_xml_rs::wrap_primitives(item, serializer, "{{{x-item-xml-name}}}") } -{{/itemXmlName}} +{{/x-item-xml-name}} {{/vendorExtensions}} {{! vec}} #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct {{{classname}}}( {{#vendorExtensions}} -{{#itemXmlName}} - #[serde(serialize_with = "wrap_in_{{{itemXmlName}}}")] -{{/itemXmlName}} +{{#x-item-xml-name}} + #[serde(serialize_with = "wrap_in_{{{x-item-xml-name}}}")] +{{/x-item-xml-name}} {{/vendorExtensions}} Vec<{{{arrayModelType}}}> ); @@ -277,9 +277,9 @@ pub struct {{{classname}}} { {{/isEnum}} #[serde(rename = "{{{baseName}}}")] {{#vendorExtensions}} -{{#itemXmlName}} - #[serde(serialize_with = "wrap_in_{{{itemXmlName}}}")] -{{/itemXmlName}} +{{#x-item-xml-name}} + #[serde(serialize_with = "wrap_in_{{{x-item-xml-name}}}")] +{{/x-item-xml-name}} {{/vendorExtensions}} {{#required}} pub {{{name}}}: {{#isNullable}}swagger::Nullable<{{/isNullable}}{{{dataType}}}{{#isNullable}}>{{/isNullable}}, @@ -478,4 +478,4 @@ impl {{{classname}}} { } {{/usesXml}} {{/model}} -{{/models}} +{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/rust-server/response.mustache b/modules/openapi-generator/src/main/resources/rust-server/response.mustache index 3e4bc94494a3..ca2dbe7a6a6c 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/response.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/response.mustache @@ -1,13 +1,13 @@ #[derive(Debug, PartialEq)] -{{#vendorExtensions.x-mustUseResponse}} +{{#vendorExtensions.x-must-use-response}} #[must_use] -{{/vendorExtensions.x-mustUseResponse}} +{{/vendorExtensions.x-must-use-response}} pub enum {{{operationId}}}Response { {{#responses}} {{#message}} /// {{{message}}}{{/message}} {{#vendorExtensions}} - {{{x-responseId}}} + {{{x-response-id}}} {{/vendorExtensions}} {{^dataType}} {{#hasHeaders}} @@ -17,23 +17,23 @@ pub enum {{{operationId}}}Response { {{#dataType}} {{^hasHeaders}} {{#vendorExtensions}} - {{#producesPlainText}} + {{#x-produces-plain-text}} (String) - {{/producesPlainText}} - {{^producesPlainText}} + {{/x-produces-plain-text}} + {{^x-produces-plain-text}} ({{{dataType}}}) - {{/producesPlainText}} + {{/x-produces-plain-text}} {{/vendorExtensions}} {{/hasHeaders}} {{#hasHeaders}} { {{#vendorExtensions}} - {{#producesPlainText}} + {{#x-produces-plain-text}} body: String, - {{/producesPlainText}} - {{^producesPlainText}} + {{/x-produces-plain-text}} + {{^x-produces-plain-text}} body: {{{dataType}}}, - {{/producesPlainText}} + {{/x-produces-plain-text}} {{/vendorExtensions}} {{/hasHeaders}} {{/dataType}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache index f3306f76a874..8243908defd7 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache @@ -38,7 +38,7 @@ {{/hasAuthMethods}} {{#vendorExtensions}} - {{#consumesMultipart}} + {{#x-consumes-multipart}} let boundary = match swagger::multipart::boundary(&headers) { Some(boundary) => boundary.to_string(), None => return Ok(Response::builder() @@ -47,8 +47,8 @@ .expect("Unable to create Bad Request response for incorrect boundary")), }; - {{/consumesMultipart}} - {{#hasPathParams}} + {{/x-consumes-multipart}} + {{#x-has-path-params}} // Path parameters let path: &str = &uri.path().to_string(); let path_params = @@ -58,7 +58,7 @@ panic!("Path {} matched RE {{{x-path-id}}} in set but failed match against \"{}\"", path, paths::REGEX_{{{x-path-id}}}.as_str()) ); - {{/hasPathParams}} + {{/x-has-path-params}} {{/vendorExtensions}} {{#pathParams}} let param_{{{paramName}}} = match percent_encoding::percent_decode(path_params["{{{baseName}}}"].as_bytes()).decode_utf8() { @@ -77,9 +77,9 @@ {{/pathParams}} {{#vendorExtensions}} - {{#callbackParams}} + {{#x-callback-params}} let callback_{{.}} = path_params["{{{.}}}"].to_string(); - {{/callbackParams}} + {{/x-callback-params}} {{/vendorExtensions}} {{#headerParams}} {{#-first}} @@ -163,7 +163,7 @@ {{/-last}} {{/queryParams}} {{#vendorExtensions}} -{{^consumesMultipart}} +{{^x-consumes-multipart}} {{#bodyParams}} {{#-first}} // Body parameters (note that non-required body parameters will ignore garbage @@ -173,17 +173,17 @@ match result { Ok(body) => { {{#vendorExtensions}} -{{^consumesPlainText}} +{{^x-consumes-plain-text}} let mut unused_elements = Vec::new(); -{{/consumesPlainText}} +{{/x-consumes-plain-text}} let param_{{{paramName}}}: Option<{{{dataType}}}> = if !body.is_empty() { -{{#consumesXml}} +{{#x-consumes-xml}} let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(&*body); -{{/consumesXml}} -{{#consumesJson}} +{{/x-consumes-xml}} +{{#x-consumes-json}} let deserializer = &mut serde_json::Deserializer::from_slice(&*body); -{{/consumesJson}} -{{^consumesPlainText}} +{{/x-consumes-json}} +{{^x-consumes-plain-text}} match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -199,8 +199,8 @@ Err(_) => None, {{/required}} } -{{/consumesPlainText}} -{{#consumesPlainText}} +{{/x-consumes-plain-text}} +{{#x-consumes-plain-text}} {{#isByteArray}} Some(swagger::ByteArray(body.to_vec())) {{/isByteArray}} @@ -213,7 +213,7 @@ .expect("Unable to create Bad Request response for invalid body parameter {{{baseName}}} due to UTF-8")), } {{/isString}} -{{/consumesPlainText}} +{{/x-consumes-plain-text}} {{/vendorExtensions}} } else { None @@ -232,8 +232,8 @@ {{/-last}} {{/bodyParams}} -{{/consumesMultipart}} -{{#consumesMultipart}} +{{/x-consumes-multipart}} +{{#x-consumes-multipart}} {{^bodyParams}} {{#vendorExtensions}} // Form Body parameters (note that non-required body parameters will ignore garbage @@ -306,25 +306,25 @@ {{/formParams}} {{/vendorExtensions}} {{/bodyParams}} -{{/consumesMultipart}} -{{^consumesMultipartRelated}} -{{^consumesMultipart}} +{{/x-consumes-multipart}} +{{^x-consumes-multipart-related}} +{{^x-consumes-multipart}} {{^bodyParams}} {{#vendorExtensions}} {{#formParams}} {{#-first}} // Form parameters {{/-first}} - let param_{{{paramName}}} = {{^isContainer}}{{#vendorExtensions}}{{{example}}};{{/vendorExtensions}}{{/isContainer}}{{#isListContainer}}{{#required}}Vec::new();{{/required}}{{^required}}None;{{/required}}{{/isListContainer}}{{#isMapContainer}}None;{{/isMapContainer}} + let param_{{{paramName}}} = {{^isContainer}}{{#vendorExtensions}}{{{x-example}}};{{/vendorExtensions}}{{/isContainer}}{{#isListContainer}}{{#required}}Vec::new();{{/required}}{{^required}}None;{{/required}}{{/isListContainer}}{{#isMapContainer}}None;{{/isMapContainer}} {{#-last}} {{/-last}} {{/formParams}} {{/vendorExtensions}} {{/bodyParams}} -{{/consumesMultipart}} -{{/consumesMultipartRelated}} -{{#consumesMultipartRelated}} +{{/x-consumes-multipart}} +{{/x-consumes-multipart-related}} +{{#x-consumes-multipart-related}} // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -432,13 +432,13 @@ {{/-last}} {{/formParams}} -{{/consumesMultipartRelated}} +{{/x-consumes-multipart-related}} {{/vendorExtensions}} - let result = api_impl.{{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}( + let result = api_impl.{{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( {{#vendorExtensions}} - {{#callbackParams}} + {{#x-callback-params}} callback_{{.}}, - {{/callbackParams}} + {{/x-callback-params}} {{/vendorExtensions}} {{#allParams}} param_{{{paramName}}}{{#isListContainer}}.as_ref(){{/isListContainer}}, @@ -453,7 +453,7 @@ {{#bodyParams}} {{#vendorExtensions}} -{{^consumesPlainText}} +{{^x-consumes-plain-text}} if !unused_elements.is_empty() { response.headers_mut().insert( HeaderName::from_static("warning"), @@ -461,13 +461,13 @@ .expect("Unable to create Warning header value")); } -{{/consumesPlainText}} +{{/x-consumes-plain-text}} {{/vendorExtensions}} {{/bodyParams}} match result { Ok(rsp) => match rsp { {{#responses}} - {{{operationId}}}Response::{{#vendorExtensions}}{{x-responseId}}{{/vendorExtensions}} + {{{operationId}}}Response::{{#vendorExtensions}}{{x-response-id}}{{/vendorExtensions}} {{#dataType}} {{^headers}} (body) @@ -520,35 +520,35 @@ {{#vendorExtensions}} response.headers_mut().insert( CONTENT_TYPE, - HeaderValue::from_str("{{{mimeType}}}") - .expect("Unable to create Content-Type header for {{{uppercase_operation_id}}}_{{x-uppercaseResponseId}}")); + HeaderValue::from_str("{{{x-mime-type}}}") + .expect("Unable to create Content-Type header for {{{x-uppercase-operation-id}}}_{{x-uppercase-response-id}}")); {{/vendorExtensions}} {{/dataType}} {{/-first}} {{/produces}} {{#dataType}} {{#vendorExtensions}} -{{#producesXml}} -{{^has_namespace}} +{{#x-produces-xml}} +{{^x-has-namespace}} let body = serde_xml_rs::to_string(&body).expect("impossible to fail to serialize"); -{{/has_namespace}} -{{#has_namespace}} +{{/x-has-namespace}} +{{#x-has-namespace}} let mut namespaces = std::collections::BTreeMap::new(); // An empty string is used to indicate a global namespace in xmltree. namespaces.insert("".to_string(), {{{dataType}}}::NAMESPACE.to_string()); let body = serde_xml_rs::to_string_with_namespaces(&body, namespaces).expect("impossible to fail to serialize"); -{{/has_namespace}} -{{/producesXml}} -{{#producesJson}} +{{/x-has-namespace}} +{{/x-produces-xml}} +{{#x-produces-json}} let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); -{{/producesJson}} -{{#producesBytes}} +{{/x-produces-json}} +{{#x-produces-bytes}} let body = body.0; -{{/producesBytes}} -{{#producesPlainText}} +{{/x-produces-bytes}} +{{#x-produces-plain-text}} let body = body; -{{/producesPlainText}} +{{/x-produces-plain-text}} {{/vendorExtensions}} *response.body_mut() = Body::from(body); {{/dataType}} @@ -565,20 +565,20 @@ Ok(response) {{#vendorExtensions}} -{{^consumesMultipart}} +{{^x-consumes-multipart}} {{^bodyParams}} {{#vendorExtensions}} -{{#consumesMultipartRelated}} +{{#x-consumes-multipart-related}} }, Err(e) => Ok(Response::builder() .status(StatusCode::BAD_REQUEST) .body(Body::from(format!("Couldn't read body parameter {{{baseName}}}: {}", e))) .expect("Unable to create Bad Request response due to unable to read body parameter {{{baseName}}}")), } -{{/consumesMultipartRelated}} +{{/x-consumes-multipart-related}} {{/vendorExtensions}} {{/bodyParams}} -{{/consumesMultipart}} +{{/x-consumes-multipart}} {{/vendorExtensions}} {{#bodyParams}} {{#-first}} @@ -591,7 +591,7 @@ {{/-first}} {{/bodyParams}} {{#vendorExtensions}} -{{#consumesMultipart}} +{{#x-consumes-multipart}} {{^bodyParams}} {{#vendorExtensions}} }, @@ -602,6 +602,6 @@ } {{/vendorExtensions}} {{/bodyParams}} -{{/consumesMultipart}} +{{/x-consumes-multipart}} {{/vendorExtensions}} }, diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index dab429fdeb37..c845b7d2cf8a 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -24,7 +24,7 @@ pub enum {{classname}} { #[serde(tag = "{{{vendorExtensions.x-tag-name}}}")] pub enum {{classname}} { {{#vendorExtensions}} - {{#mappedModels}} + {{#x-mapped-models}} #[serde(rename="{{mappingName}}")] {{modelName}} { {{#vars}} @@ -35,7 +35,7 @@ pub enum {{classname}} { {{{name}}}: {{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{^required}}Option<{{/required}}{{#isEnum}}{{{enumName}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^required}}>{{/required}}, {{/vars}} }, - {{/mappedModels}} + {{/x-mapped-models}} {{/vendorExtensions}} } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java index fce15f7b2e73..81c4978e7873 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java @@ -38,14 +38,14 @@ public abstract class AbstractIntegrationTest { protected Boolean generateMetadata = true; - protected Map systemPropertyOverrides = new HashMap<>(); + protected Map globalPropertyOverrides = new HashMap<>(); // @wing328: ignore for the time being until we fix the error with the integration test @Test(enabled = false) public void generatesCorrectDirectoryStructure() throws IOException { DefaultGenerator codeGen = new DefaultGenerator(); codeGen.setGenerateMetadata(generateMetadata); - for (Map.Entry propertyOverride : systemPropertyOverrides.entrySet()) { + for (Map.Entry propertyOverride : globalPropertyOverrides.entrySet()) { codeGen.setGeneratorPropertyDefault(propertyOverride.getKey(), propertyOverride.getValue()); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java index 7cd8aa957989..7055bff46595 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/config/CodegenConfiguratorTest.java @@ -19,7 +19,6 @@ import org.openapitools.codegen.ClientOptInput; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.DefaultGenerator; import org.testng.annotations.Test; import java.io.File; @@ -66,7 +65,7 @@ public void shouldSetConfiglProperties() throws IOException { .addImportMapping("one", "two") .addInstantiationType("three", "four") .addLanguageSpecificPrimitive("five") - .addSystemProperty("six", "seven") + .addGlobalProperty("six", "seven") .addTypeMapping("eight", "nine") .setApiPackage("test-api") .setArtifactId("test-artifactId") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalDataTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalDataTest.java index 9f8f969b49a2..5a10f3d219d0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalDataTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalDataTest.java @@ -53,7 +53,7 @@ public void testGeneralUsage() { o.addToImplementor(cc, implModel, implModelImports, false); // make sure all the additions were done correctly - Assert.assertEquals(implModel.getVendorExtensions().get("implements"), new ArrayList(){{add(oneOfModel.classname);}}); + Assert.assertEquals(implModel.getVendorExtensions().get("x-implements"), new ArrayList(){{add(oneOfModel.classname);}}); Assert.assertEquals(implModelImports, interfaceModelImports); Assert.assertEquals(implModel.vars, new ArrayList(){{add(cp3); add(cp1);}}); Assert.assertTrue(implModel.vars.get(0).hasMore); diff --git a/modules/openapi-generator/src/test/resources/sampleConfig.json b/modules/openapi-generator/src/test/resources/sampleConfig.json index 17dd8ab86696..1c59ab4e5461 100644 --- a/modules/openapi-generator/src/test/resources/sampleConfig.json +++ b/modules/openapi-generator/src/test/resources/sampleConfig.json @@ -14,7 +14,7 @@ "artifactVersion" : "1.2.3", "library" : "jersey2", "ignoreFileOverride": "/path/to/override/.openapi-generator-ignore", - "systemProperties" : { + "globalProperties" : { "systemProp1" : "value1" }, "instantiationTypes" : { diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index 1331ed4b237d..53327dc686a3 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -2039,7 +2039,7 @@ toE'ArrayEnum = \case -- ** E'EnumFormString --- | Enum of 'Text' . +-- | Enum of 'Text' . -- Form parameter enum test (string) data E'EnumFormString = E'EnumFormString'_abc -- ^ @"_abc"@ @@ -2304,7 +2304,7 @@ toE'Kind = \case -- ** E'Status --- | Enum of 'Text' . +-- | Enum of 'Text' . -- Order Status data E'Status = E'Status'Placed -- ^ @"placed"@ @@ -2336,7 +2336,7 @@ toE'Status = \case -- ** E'Status2 --- | Enum of 'Text' . +-- | Enum of 'Text' . -- pet status in the store data E'Status2 = E'Status2'Available -- ^ @"available"@ diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES index 61a40c4b9a02..1bb03794c747 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -32,12 +32,6 @@ docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md -docs/InlineObject3.md -docs/InlineObject4.md -docs/InlineObject5.md docs/InlineResponseDefault.md docs/List.md docs/MapTest.md @@ -97,12 +91,6 @@ lib/petstore/models/foo.rb lib/petstore/models/format_test.rb lib/petstore/models/has_only_read_only.rb lib/petstore/models/health_check_result.rb -lib/petstore/models/inline_object.rb -lib/petstore/models/inline_object1.rb -lib/petstore/models/inline_object2.rb -lib/petstore/models/inline_object3.rb -lib/petstore/models/inline_object4.rb -lib/petstore/models/inline_object5.rb lib/petstore/models/inline_response_default.rb lib/petstore/models/list.rb lib/petstore/models/map_test.rb @@ -157,12 +145,6 @@ spec/models/foo_spec.rb spec/models/format_test_spec.rb spec/models/has_only_read_only_spec.rb spec/models/health_check_result_spec.rb -spec/models/inline_object1_spec.rb -spec/models/inline_object2_spec.rb -spec/models/inline_object3_spec.rb -spec/models/inline_object4_spec.rb -spec/models/inline_object5_spec.rb -spec/models/inline_object_spec.rb spec/models/inline_response_default_spec.rb spec/models/list_spec.rb spec/models/map_test_spec.rb diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index 719039e53116..35c76f3817e4 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -141,12 +141,6 @@ Class | Method | HTTP request | Description - [Petstore::FormatTest](docs/FormatTest.md) - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [Petstore::HealthCheckResult](docs/HealthCheckResult.md) - - [Petstore::InlineObject](docs/InlineObject.md) - - [Petstore::InlineObject1](docs/InlineObject1.md) - - [Petstore::InlineObject2](docs/InlineObject2.md) - - [Petstore::InlineObject3](docs/InlineObject3.md) - - [Petstore::InlineObject4](docs/InlineObject4.md) - - [Petstore::InlineObject5](docs/InlineObject5.md) - [Petstore::InlineResponseDefault](docs/InlineResponseDefault.md) - [Petstore::List](docs/List.md) - [Petstore::MapTest](docs/MapTest.md) diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject.md b/samples/client/petstore/ruby-faraday/docs/InlineObject.md deleted file mode 100644 index f5211d44464c..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/InlineObject.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::InlineObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Updated name of the pet | [optional] -**status** | **String** | Updated status of the pet | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject.new(name: null, - status: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject1.md b/samples/client/petstore/ruby-faraday/docs/InlineObject1.md deleted file mode 100644 index bac17e753cdc..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/InlineObject1.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::InlineObject1 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additional_metadata** | **String** | Additional data to pass to server | [optional] -**file** | **File** | file to upload | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject1.new(additional_metadata: null, - file: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject2.md b/samples/client/petstore/ruby-faraday/docs/InlineObject2.md deleted file mode 100644 index 31118c5b262e..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/InlineObject2.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::InlineObject2 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_form_string_array** | **Array<String>** | Form parameter enum test (string array) | [optional] -**enum_form_string** | **String** | Form parameter enum test (string) | [optional] [default to '-efg'] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject2.new(enum_form_string_array: null, - enum_form_string: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject3.md b/samples/client/petstore/ruby-faraday/docs/InlineObject3.md deleted file mode 100644 index b6cb7ccb29b1..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/InlineObject3.md +++ /dev/null @@ -1,43 +0,0 @@ -# Petstore::InlineObject3 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Integer** | None | [optional] -**int32** | **Integer** | None | [optional] -**int64** | **Integer** | None | [optional] -**number** | **Float** | None | -**float** | **Float** | None | [optional] -**double** | **Float** | None | -**string** | **String** | None | [optional] -**pattern_without_delimiter** | **String** | None | -**byte** | **String** | None | -**binary** | **File** | None | [optional] -**date** | **Date** | None | [optional] -**date_time** | **DateTime** | None | [optional] -**password** | **String** | None | [optional] -**callback** | **String** | None | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject3.new(integer: null, - int32: null, - int64: null, - number: null, - float: null, - double: null, - string: null, - pattern_without_delimiter: null, - byte: null, - binary: null, - date: null, - date_time: null, - password: null, - callback: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject4.md b/samples/client/petstore/ruby-faraday/docs/InlineObject4.md deleted file mode 100644 index 97179c3e3772..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/InlineObject4.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::InlineObject4 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**param** | **String** | field1 | -**param2** | **String** | field2 | - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject4.new(param: null, - param2: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/docs/InlineObject5.md b/samples/client/petstore/ruby-faraday/docs/InlineObject5.md deleted file mode 100644 index 23c1df99ffeb..000000000000 --- a/samples/client/petstore/ruby-faraday/docs/InlineObject5.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::InlineObject5 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additional_metadata** | **String** | Additional data to pass to server | [optional] -**required_file** | **File** | file to upload | - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject5.new(additional_metadata: null, - required_file: null) -``` - - diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 7f8ae56e123b..f0df2170db08 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -40,12 +40,6 @@ require 'petstore/models/format_test' require 'petstore/models/has_only_read_only' require 'petstore/models/health_check_result' -require 'petstore/models/inline_object' -require 'petstore/models/inline_object1' -require 'petstore/models/inline_object2' -require 'petstore/models/inline_object3' -require 'petstore/models/inline_object4' -require 'petstore/models/inline_object5' require 'petstore/models/inline_response_default' require 'petstore/models/list' require 'petstore/models/map_test' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb deleted file mode 100644 index 7d2ce0e05f39..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject - # Updated name of the pet - attr_accessor :name - - # Updated status of the pet - attr_accessor :status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'status' => :'status' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'status' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb deleted file mode 100644 index 45a9d5bfcd72..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject1 - # Additional data to pass to server - attr_accessor :additional_metadata - - # file to upload - attr_accessor :file - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'additional_metadata' => :'additionalMetadata', - :'file' => :'file' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'additional_metadata' => :'String', - :'file' => :'File' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject1` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'additional_metadata') - self.additional_metadata = attributes[:'additional_metadata'] - end - - if attributes.key?(:'file') - self.file = attributes[:'file'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - additional_metadata == o.additional_metadata && - file == o.file - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [additional_metadata, file].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb deleted file mode 100644 index 51784af066b6..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject2 - # Form parameter enum test (string array) - attr_accessor :enum_form_string_array - - # Form parameter enum test (string) - attr_accessor :enum_form_string - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enum_form_string_array' => :'enum_form_string_array', - :'enum_form_string' => :'enum_form_string' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'enum_form_string_array' => :'Array', - :'enum_form_string' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject2` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enum_form_string_array') - if (value = attributes[:'enum_form_string_array']).is_a?(Array) - self.enum_form_string_array = value - end - end - - if attributes.key?(:'enum_form_string') - self.enum_form_string = attributes[:'enum_form_string'] - else - self.enum_form_string = '-efg' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - enum_form_string_validator = EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) - return false unless enum_form_string_validator.valid?(@enum_form_string) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] enum_form_string Object to be assigned - def enum_form_string=(enum_form_string) - validator = EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) - unless validator.valid?(enum_form_string) - fail ArgumentError, "invalid value for \"enum_form_string\", must be one of #{validator.allowable_values}." - end - @enum_form_string = enum_form_string - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enum_form_string_array == o.enum_form_string_array && - enum_form_string == o.enum_form_string - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enum_form_string_array, enum_form_string].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb deleted file mode 100644 index 71fe8bd38a82..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb +++ /dev/null @@ -1,538 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject3 - # None - attr_accessor :integer - - # None - attr_accessor :int32 - - # None - attr_accessor :int64 - - # None - attr_accessor :number - - # None - attr_accessor :float - - # None - attr_accessor :double - - # None - attr_accessor :string - - # None - attr_accessor :pattern_without_delimiter - - # None - attr_accessor :byte - - # None - attr_accessor :binary - - # None - attr_accessor :date - - # None - attr_accessor :date_time - - # None - attr_accessor :password - - # None - attr_accessor :callback - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'integer' => :'integer', - :'int32' => :'int32', - :'int64' => :'int64', - :'number' => :'number', - :'float' => :'float', - :'double' => :'double', - :'string' => :'string', - :'pattern_without_delimiter' => :'pattern_without_delimiter', - :'byte' => :'byte', - :'binary' => :'binary', - :'date' => :'date', - :'date_time' => :'dateTime', - :'password' => :'password', - :'callback' => :'callback' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'integer' => :'Integer', - :'int32' => :'Integer', - :'int64' => :'Integer', - :'number' => :'Float', - :'float' => :'Float', - :'double' => :'Float', - :'string' => :'String', - :'pattern_without_delimiter' => :'String', - :'byte' => :'String', - :'binary' => :'File', - :'date' => :'Date', - :'date_time' => :'DateTime', - :'password' => :'String', - :'callback' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject3` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'integer') - self.integer = attributes[:'integer'] - end - - if attributes.key?(:'int32') - self.int32 = attributes[:'int32'] - end - - if attributes.key?(:'int64') - self.int64 = attributes[:'int64'] - end - - if attributes.key?(:'number') - self.number = attributes[:'number'] - end - - if attributes.key?(:'float') - self.float = attributes[:'float'] - end - - if attributes.key?(:'double') - self.double = attributes[:'double'] - end - - if attributes.key?(:'string') - self.string = attributes[:'string'] - end - - if attributes.key?(:'pattern_without_delimiter') - self.pattern_without_delimiter = attributes[:'pattern_without_delimiter'] - end - - if attributes.key?(:'byte') - self.byte = attributes[:'byte'] - end - - if attributes.key?(:'binary') - self.binary = attributes[:'binary'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'date_time') - self.date_time = attributes[:'date_time'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'callback') - self.callback = attributes[:'callback'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@integer.nil? && @integer > 100 - invalid_properties.push('invalid value for "integer", must be smaller than or equal to 100.') - end - - if !@integer.nil? && @integer < 10 - invalid_properties.push('invalid value for "integer", must be greater than or equal to 10.') - end - - if !@int32.nil? && @int32 > 200 - invalid_properties.push('invalid value for "int32", must be smaller than or equal to 200.') - end - - if !@int32.nil? && @int32 < 20 - invalid_properties.push('invalid value for "int32", must be greater than or equal to 20.') - end - - if @number.nil? - invalid_properties.push('invalid value for "number", number cannot be nil.') - end - - if @number > 543.2 - invalid_properties.push('invalid value for "number", must be smaller than or equal to 543.2.') - end - - if @number < 32.1 - invalid_properties.push('invalid value for "number", must be greater than or equal to 32.1.') - end - - if !@float.nil? && @float > 987.6 - invalid_properties.push('invalid value for "float", must be smaller than or equal to 987.6.') - end - - if @double.nil? - invalid_properties.push('invalid value for "double", double cannot be nil.') - end - - if @double > 123.4 - invalid_properties.push('invalid value for "double", must be smaller than or equal to 123.4.') - end - - if @double < 67.8 - invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.') - end - - pattern = Regexp.new(/[a-z]/i) - if !@string.nil? && @string !~ pattern - invalid_properties.push("invalid value for \"string\", must conform to the pattern #{pattern}.") - end - - if @pattern_without_delimiter.nil? - invalid_properties.push('invalid value for "pattern_without_delimiter", pattern_without_delimiter cannot be nil.') - end - - pattern = Regexp.new(/^[A-Z].*/) - if @pattern_without_delimiter !~ pattern - invalid_properties.push("invalid value for \"pattern_without_delimiter\", must conform to the pattern #{pattern}.") - end - - if @byte.nil? - invalid_properties.push('invalid value for "byte", byte cannot be nil.') - end - - if !@password.nil? && @password.to_s.length > 64 - invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 64.') - end - - if !@password.nil? && @password.to_s.length < 10 - invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@integer.nil? && @integer > 100 - return false if !@integer.nil? && @integer < 10 - return false if !@int32.nil? && @int32 > 200 - return false if !@int32.nil? && @int32 < 20 - return false if @number.nil? - return false if @number > 543.2 - return false if @number < 32.1 - return false if !@float.nil? && @float > 987.6 - return false if @double.nil? - return false if @double > 123.4 - return false if @double < 67.8 - return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) - return false if @pattern_without_delimiter.nil? - return false if @pattern_without_delimiter !~ Regexp.new(/^[A-Z].*/) - return false if @byte.nil? - return false if !@password.nil? && @password.to_s.length > 64 - return false if !@password.nil? && @password.to_s.length < 10 - true - end - - # Custom attribute writer method with validation - # @param [Object] integer Value to be assigned - def integer=(integer) - if !integer.nil? && integer > 100 - fail ArgumentError, 'invalid value for "integer", must be smaller than or equal to 100.' - end - - if !integer.nil? && integer < 10 - fail ArgumentError, 'invalid value for "integer", must be greater than or equal to 10.' - end - - @integer = integer - end - - # Custom attribute writer method with validation - # @param [Object] int32 Value to be assigned - def int32=(int32) - if !int32.nil? && int32 > 200 - fail ArgumentError, 'invalid value for "int32", must be smaller than or equal to 200.' - end - - if !int32.nil? && int32 < 20 - fail ArgumentError, 'invalid value for "int32", must be greater than or equal to 20.' - end - - @int32 = int32 - end - - # Custom attribute writer method with validation - # @param [Object] number Value to be assigned - def number=(number) - if number.nil? - fail ArgumentError, 'number cannot be nil' - end - - if number > 543.2 - fail ArgumentError, 'invalid value for "number", must be smaller than or equal to 543.2.' - end - - if number < 32.1 - fail ArgumentError, 'invalid value for "number", must be greater than or equal to 32.1.' - end - - @number = number - end - - # Custom attribute writer method with validation - # @param [Object] float Value to be assigned - def float=(float) - if !float.nil? && float > 987.6 - fail ArgumentError, 'invalid value for "float", must be smaller than or equal to 987.6.' - end - - @float = float - end - - # Custom attribute writer method with validation - # @param [Object] double Value to be assigned - def double=(double) - if double.nil? - fail ArgumentError, 'double cannot be nil' - end - - if double > 123.4 - fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 123.4.' - end - - if double < 67.8 - fail ArgumentError, 'invalid value for "double", must be greater than or equal to 67.8.' - end - - @double = double - end - - # Custom attribute writer method with validation - # @param [Object] string Value to be assigned - def string=(string) - pattern = Regexp.new(/[a-z]/i) - if !string.nil? && string !~ pattern - fail ArgumentError, "invalid value for \"string\", must conform to the pattern #{pattern}." - end - - @string = string - end - - # Custom attribute writer method with validation - # @param [Object] pattern_without_delimiter Value to be assigned - def pattern_without_delimiter=(pattern_without_delimiter) - if pattern_without_delimiter.nil? - fail ArgumentError, 'pattern_without_delimiter cannot be nil' - end - - pattern = Regexp.new(/^[A-Z].*/) - if pattern_without_delimiter !~ pattern - fail ArgumentError, "invalid value for \"pattern_without_delimiter\", must conform to the pattern #{pattern}." - end - - @pattern_without_delimiter = pattern_without_delimiter - end - - # Custom attribute writer method with validation - # @param [Object] password Value to be assigned - def password=(password) - if !password.nil? && password.to_s.length > 64 - fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 64.' - end - - if !password.nil? && password.to_s.length < 10 - fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.' - end - - @password = password - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - integer == o.integer && - int32 == o.int32 && - int64 == o.int64 && - number == o.number && - float == o.float && - double == o.double && - string == o.string && - pattern_without_delimiter == o.pattern_without_delimiter && - byte == o.byte && - binary == o.binary && - date == o.date && - date_time == o.date_time && - password == o.password && - callback == o.callback - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [integer, int32, int64, number, float, double, string, pattern_without_delimiter, byte, binary, date, date_time, password, callback].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb deleted file mode 100644 index 560e747ce79c..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject4 - # field1 - attr_accessor :param - - # field2 - attr_accessor :param2 - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'param' => :'param', - :'param2' => :'param2' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'param' => :'String', - :'param2' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject4` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject4`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'param') - self.param = attributes[:'param'] - end - - if attributes.key?(:'param2') - self.param2 = attributes[:'param2'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @param.nil? - invalid_properties.push('invalid value for "param", param cannot be nil.') - end - - if @param2.nil? - invalid_properties.push('invalid value for "param2", param2 cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @param.nil? - return false if @param2.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - param == o.param && - param2 == o.param2 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [param, param2].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb deleted file mode 100644 index e75bb452989a..000000000000 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject5 - # Additional data to pass to server - attr_accessor :additional_metadata - - # file to upload - attr_accessor :required_file - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'additional_metadata' => :'additionalMetadata', - :'required_file' => :'requiredFile' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'additional_metadata' => :'String', - :'required_file' => :'File' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject5` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject5`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'additional_metadata') - self.additional_metadata = attributes[:'additional_metadata'] - end - - if attributes.key?(:'required_file') - self.required_file = attributes[:'required_file'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @required_file.nil? - invalid_properties.push('invalid value for "required_file", required_file cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @required_file.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - additional_metadata == o.additional_metadata && - required_file == o.required_file - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [additional_metadata, required_file].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb deleted file mode 100644 index a702fd774eac..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject1 -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject1' do - before do - # run before each test - @instance = Petstore::InlineObject1.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject1' do - it 'should create an instance of InlineObject1' do - expect(@instance).to be_instance_of(Petstore::InlineObject1) - end - end - describe 'test attribute "additional_metadata"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "file"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb deleted file mode 100644 index 7013915ea39d..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject2 -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject2' do - before do - # run before each test - @instance = Petstore::InlineObject2.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject2' do - it 'should create an instance of InlineObject2' do - expect(@instance).to be_instance_of(Petstore::InlineObject2) - end - end - describe 'test attribute "enum_form_string_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', [">", "$"]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_form_string_array = value }.not_to raise_error - # end - end - end - - describe 'test attribute "enum_form_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_form_string = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb deleted file mode 100644 index 4daf41b4ace0..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb +++ /dev/null @@ -1,119 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject3 -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject3' do - before do - # run before each test - @instance = Petstore::InlineObject3.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject3' do - it 'should create an instance of InlineObject3' do - expect(@instance).to be_instance_of(Petstore::InlineObject3) - end - end - describe 'test attribute "integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "int32"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "int64"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "float"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "double"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "pattern_without_delimiter"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "byte"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "binary"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "date"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "date_time"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "callback"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb deleted file mode 100644 index fa806f95860c..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject4 -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject4' do - before do - # run before each test - @instance = Petstore::InlineObject4.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject4' do - it 'should create an instance of InlineObject4' do - expect(@instance).to be_instance_of(Petstore::InlineObject4) - end - end - describe 'test attribute "param"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "param2"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb deleted file mode 100644 index e2410b21bc09..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject5 -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject5' do - before do - # run before each test - @instance = Petstore::InlineObject5.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject5' do - it 'should create an instance of InlineObject5' do - expect(@instance).to be_instance_of(Petstore::InlineObject5) - end - end - describe 'test attribute "additional_metadata"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "required_file"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb deleted file mode 100644 index c5a7db44780e..000000000000 --- a/samples/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject' do - before do - # run before each test - @instance = Petstore::InlineObject.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject' do - it 'should create an instance of InlineObject' do - expect(@instance).to be_instance_of(Petstore::InlineObject) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/.openapi-generator/FILES b/samples/client/petstore/ruby/.openapi-generator/FILES index 61a40c4b9a02..1bb03794c747 100644 --- a/samples/client/petstore/ruby/.openapi-generator/FILES +++ b/samples/client/petstore/ruby/.openapi-generator/FILES @@ -32,12 +32,6 @@ docs/Foo.md docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md -docs/InlineObject3.md -docs/InlineObject4.md -docs/InlineObject5.md docs/InlineResponseDefault.md docs/List.md docs/MapTest.md @@ -97,12 +91,6 @@ lib/petstore/models/foo.rb lib/petstore/models/format_test.rb lib/petstore/models/has_only_read_only.rb lib/petstore/models/health_check_result.rb -lib/petstore/models/inline_object.rb -lib/petstore/models/inline_object1.rb -lib/petstore/models/inline_object2.rb -lib/petstore/models/inline_object3.rb -lib/petstore/models/inline_object4.rb -lib/petstore/models/inline_object5.rb lib/petstore/models/inline_response_default.rb lib/petstore/models/list.rb lib/petstore/models/map_test.rb @@ -157,12 +145,6 @@ spec/models/foo_spec.rb spec/models/format_test_spec.rb spec/models/has_only_read_only_spec.rb spec/models/health_check_result_spec.rb -spec/models/inline_object1_spec.rb -spec/models/inline_object2_spec.rb -spec/models/inline_object3_spec.rb -spec/models/inline_object4_spec.rb -spec/models/inline_object5_spec.rb -spec/models/inline_object_spec.rb spec/models/inline_response_default_spec.rb spec/models/list_spec.rb spec/models/map_test_spec.rb diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 719039e53116..35c76f3817e4 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -141,12 +141,6 @@ Class | Method | HTTP request | Description - [Petstore::FormatTest](docs/FormatTest.md) - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [Petstore::HealthCheckResult](docs/HealthCheckResult.md) - - [Petstore::InlineObject](docs/InlineObject.md) - - [Petstore::InlineObject1](docs/InlineObject1.md) - - [Petstore::InlineObject2](docs/InlineObject2.md) - - [Petstore::InlineObject3](docs/InlineObject3.md) - - [Petstore::InlineObject4](docs/InlineObject4.md) - - [Petstore::InlineObject5](docs/InlineObject5.md) - [Petstore::InlineResponseDefault](docs/InlineResponseDefault.md) - [Petstore::List](docs/List.md) - [Petstore::MapTest](docs/MapTest.md) diff --git a/samples/client/petstore/ruby/docs/InlineObject.md b/samples/client/petstore/ruby/docs/InlineObject.md deleted file mode 100644 index f5211d44464c..000000000000 --- a/samples/client/petstore/ruby/docs/InlineObject.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::InlineObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Updated name of the pet | [optional] -**status** | **String** | Updated status of the pet | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject.new(name: null, - status: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/InlineObject1.md b/samples/client/petstore/ruby/docs/InlineObject1.md deleted file mode 100644 index bac17e753cdc..000000000000 --- a/samples/client/petstore/ruby/docs/InlineObject1.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::InlineObject1 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additional_metadata** | **String** | Additional data to pass to server | [optional] -**file** | **File** | file to upload | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject1.new(additional_metadata: null, - file: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/InlineObject2.md b/samples/client/petstore/ruby/docs/InlineObject2.md deleted file mode 100644 index 31118c5b262e..000000000000 --- a/samples/client/petstore/ruby/docs/InlineObject2.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::InlineObject2 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_form_string_array** | **Array<String>** | Form parameter enum test (string array) | [optional] -**enum_form_string** | **String** | Form parameter enum test (string) | [optional] [default to '-efg'] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject2.new(enum_form_string_array: null, - enum_form_string: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/InlineObject3.md b/samples/client/petstore/ruby/docs/InlineObject3.md deleted file mode 100644 index b6cb7ccb29b1..000000000000 --- a/samples/client/petstore/ruby/docs/InlineObject3.md +++ /dev/null @@ -1,43 +0,0 @@ -# Petstore::InlineObject3 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Integer** | None | [optional] -**int32** | **Integer** | None | [optional] -**int64** | **Integer** | None | [optional] -**number** | **Float** | None | -**float** | **Float** | None | [optional] -**double** | **Float** | None | -**string** | **String** | None | [optional] -**pattern_without_delimiter** | **String** | None | -**byte** | **String** | None | -**binary** | **File** | None | [optional] -**date** | **Date** | None | [optional] -**date_time** | **DateTime** | None | [optional] -**password** | **String** | None | [optional] -**callback** | **String** | None | [optional] - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject3.new(integer: null, - int32: null, - int64: null, - number: null, - float: null, - double: null, - string: null, - pattern_without_delimiter: null, - byte: null, - binary: null, - date: null, - date_time: null, - password: null, - callback: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/InlineObject4.md b/samples/client/petstore/ruby/docs/InlineObject4.md deleted file mode 100644 index 97179c3e3772..000000000000 --- a/samples/client/petstore/ruby/docs/InlineObject4.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::InlineObject4 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**param** | **String** | field1 | -**param2** | **String** | field2 | - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject4.new(param: null, - param2: null) -``` - - diff --git a/samples/client/petstore/ruby/docs/InlineObject5.md b/samples/client/petstore/ruby/docs/InlineObject5.md deleted file mode 100644 index 23c1df99ffeb..000000000000 --- a/samples/client/petstore/ruby/docs/InlineObject5.md +++ /dev/null @@ -1,19 +0,0 @@ -# Petstore::InlineObject5 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additional_metadata** | **String** | Additional data to pass to server | [optional] -**required_file** | **File** | file to upload | - -## Code Sample - -```ruby -require 'Petstore' - -instance = Petstore::InlineObject5.new(additional_metadata: null, - required_file: null) -``` - - diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 7f8ae56e123b..f0df2170db08 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -40,12 +40,6 @@ require 'petstore/models/format_test' require 'petstore/models/has_only_read_only' require 'petstore/models/health_check_result' -require 'petstore/models/inline_object' -require 'petstore/models/inline_object1' -require 'petstore/models/inline_object2' -require 'petstore/models/inline_object3' -require 'petstore/models/inline_object4' -require 'petstore/models/inline_object5' require 'petstore/models/inline_response_default' require 'petstore/models/list' require 'petstore/models/map_test' diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb deleted file mode 100644 index 7d2ce0e05f39..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject - # Updated name of the pet - attr_accessor :name - - # Updated status of the pet - attr_accessor :status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'status' => :'status' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'status' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb deleted file mode 100644 index 45a9d5bfcd72..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject1 - # Additional data to pass to server - attr_accessor :additional_metadata - - # file to upload - attr_accessor :file - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'additional_metadata' => :'additionalMetadata', - :'file' => :'file' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'additional_metadata' => :'String', - :'file' => :'File' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject1` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'additional_metadata') - self.additional_metadata = attributes[:'additional_metadata'] - end - - if attributes.key?(:'file') - self.file = attributes[:'file'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - additional_metadata == o.additional_metadata && - file == o.file - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [additional_metadata, file].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb deleted file mode 100644 index 51784af066b6..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject2 - # Form parameter enum test (string array) - attr_accessor :enum_form_string_array - - # Form parameter enum test (string) - attr_accessor :enum_form_string - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enum_form_string_array' => :'enum_form_string_array', - :'enum_form_string' => :'enum_form_string' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'enum_form_string_array' => :'Array', - :'enum_form_string' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject2` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enum_form_string_array') - if (value = attributes[:'enum_form_string_array']).is_a?(Array) - self.enum_form_string_array = value - end - end - - if attributes.key?(:'enum_form_string') - self.enum_form_string = attributes[:'enum_form_string'] - else - self.enum_form_string = '-efg' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - enum_form_string_validator = EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) - return false unless enum_form_string_validator.valid?(@enum_form_string) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] enum_form_string Object to be assigned - def enum_form_string=(enum_form_string) - validator = EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) - unless validator.valid?(enum_form_string) - fail ArgumentError, "invalid value for \"enum_form_string\", must be one of #{validator.allowable_values}." - end - @enum_form_string = enum_form_string - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enum_form_string_array == o.enum_form_string_array && - enum_form_string == o.enum_form_string - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enum_form_string_array, enum_form_string].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb deleted file mode 100644 index 71fe8bd38a82..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb +++ /dev/null @@ -1,538 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject3 - # None - attr_accessor :integer - - # None - attr_accessor :int32 - - # None - attr_accessor :int64 - - # None - attr_accessor :number - - # None - attr_accessor :float - - # None - attr_accessor :double - - # None - attr_accessor :string - - # None - attr_accessor :pattern_without_delimiter - - # None - attr_accessor :byte - - # None - attr_accessor :binary - - # None - attr_accessor :date - - # None - attr_accessor :date_time - - # None - attr_accessor :password - - # None - attr_accessor :callback - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'integer' => :'integer', - :'int32' => :'int32', - :'int64' => :'int64', - :'number' => :'number', - :'float' => :'float', - :'double' => :'double', - :'string' => :'string', - :'pattern_without_delimiter' => :'pattern_without_delimiter', - :'byte' => :'byte', - :'binary' => :'binary', - :'date' => :'date', - :'date_time' => :'dateTime', - :'password' => :'password', - :'callback' => :'callback' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'integer' => :'Integer', - :'int32' => :'Integer', - :'int64' => :'Integer', - :'number' => :'Float', - :'float' => :'Float', - :'double' => :'Float', - :'string' => :'String', - :'pattern_without_delimiter' => :'String', - :'byte' => :'String', - :'binary' => :'File', - :'date' => :'Date', - :'date_time' => :'DateTime', - :'password' => :'String', - :'callback' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject3` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'integer') - self.integer = attributes[:'integer'] - end - - if attributes.key?(:'int32') - self.int32 = attributes[:'int32'] - end - - if attributes.key?(:'int64') - self.int64 = attributes[:'int64'] - end - - if attributes.key?(:'number') - self.number = attributes[:'number'] - end - - if attributes.key?(:'float') - self.float = attributes[:'float'] - end - - if attributes.key?(:'double') - self.double = attributes[:'double'] - end - - if attributes.key?(:'string') - self.string = attributes[:'string'] - end - - if attributes.key?(:'pattern_without_delimiter') - self.pattern_without_delimiter = attributes[:'pattern_without_delimiter'] - end - - if attributes.key?(:'byte') - self.byte = attributes[:'byte'] - end - - if attributes.key?(:'binary') - self.binary = attributes[:'binary'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'date_time') - self.date_time = attributes[:'date_time'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'callback') - self.callback = attributes[:'callback'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@integer.nil? && @integer > 100 - invalid_properties.push('invalid value for "integer", must be smaller than or equal to 100.') - end - - if !@integer.nil? && @integer < 10 - invalid_properties.push('invalid value for "integer", must be greater than or equal to 10.') - end - - if !@int32.nil? && @int32 > 200 - invalid_properties.push('invalid value for "int32", must be smaller than or equal to 200.') - end - - if !@int32.nil? && @int32 < 20 - invalid_properties.push('invalid value for "int32", must be greater than or equal to 20.') - end - - if @number.nil? - invalid_properties.push('invalid value for "number", number cannot be nil.') - end - - if @number > 543.2 - invalid_properties.push('invalid value for "number", must be smaller than or equal to 543.2.') - end - - if @number < 32.1 - invalid_properties.push('invalid value for "number", must be greater than or equal to 32.1.') - end - - if !@float.nil? && @float > 987.6 - invalid_properties.push('invalid value for "float", must be smaller than or equal to 987.6.') - end - - if @double.nil? - invalid_properties.push('invalid value for "double", double cannot be nil.') - end - - if @double > 123.4 - invalid_properties.push('invalid value for "double", must be smaller than or equal to 123.4.') - end - - if @double < 67.8 - invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.') - end - - pattern = Regexp.new(/[a-z]/i) - if !@string.nil? && @string !~ pattern - invalid_properties.push("invalid value for \"string\", must conform to the pattern #{pattern}.") - end - - if @pattern_without_delimiter.nil? - invalid_properties.push('invalid value for "pattern_without_delimiter", pattern_without_delimiter cannot be nil.') - end - - pattern = Regexp.new(/^[A-Z].*/) - if @pattern_without_delimiter !~ pattern - invalid_properties.push("invalid value for \"pattern_without_delimiter\", must conform to the pattern #{pattern}.") - end - - if @byte.nil? - invalid_properties.push('invalid value for "byte", byte cannot be nil.') - end - - if !@password.nil? && @password.to_s.length > 64 - invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 64.') - end - - if !@password.nil? && @password.to_s.length < 10 - invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@integer.nil? && @integer > 100 - return false if !@integer.nil? && @integer < 10 - return false if !@int32.nil? && @int32 > 200 - return false if !@int32.nil? && @int32 < 20 - return false if @number.nil? - return false if @number > 543.2 - return false if @number < 32.1 - return false if !@float.nil? && @float > 987.6 - return false if @double.nil? - return false if @double > 123.4 - return false if @double < 67.8 - return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) - return false if @pattern_without_delimiter.nil? - return false if @pattern_without_delimiter !~ Regexp.new(/^[A-Z].*/) - return false if @byte.nil? - return false if !@password.nil? && @password.to_s.length > 64 - return false if !@password.nil? && @password.to_s.length < 10 - true - end - - # Custom attribute writer method with validation - # @param [Object] integer Value to be assigned - def integer=(integer) - if !integer.nil? && integer > 100 - fail ArgumentError, 'invalid value for "integer", must be smaller than or equal to 100.' - end - - if !integer.nil? && integer < 10 - fail ArgumentError, 'invalid value for "integer", must be greater than or equal to 10.' - end - - @integer = integer - end - - # Custom attribute writer method with validation - # @param [Object] int32 Value to be assigned - def int32=(int32) - if !int32.nil? && int32 > 200 - fail ArgumentError, 'invalid value for "int32", must be smaller than or equal to 200.' - end - - if !int32.nil? && int32 < 20 - fail ArgumentError, 'invalid value for "int32", must be greater than or equal to 20.' - end - - @int32 = int32 - end - - # Custom attribute writer method with validation - # @param [Object] number Value to be assigned - def number=(number) - if number.nil? - fail ArgumentError, 'number cannot be nil' - end - - if number > 543.2 - fail ArgumentError, 'invalid value for "number", must be smaller than or equal to 543.2.' - end - - if number < 32.1 - fail ArgumentError, 'invalid value for "number", must be greater than or equal to 32.1.' - end - - @number = number - end - - # Custom attribute writer method with validation - # @param [Object] float Value to be assigned - def float=(float) - if !float.nil? && float > 987.6 - fail ArgumentError, 'invalid value for "float", must be smaller than or equal to 987.6.' - end - - @float = float - end - - # Custom attribute writer method with validation - # @param [Object] double Value to be assigned - def double=(double) - if double.nil? - fail ArgumentError, 'double cannot be nil' - end - - if double > 123.4 - fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 123.4.' - end - - if double < 67.8 - fail ArgumentError, 'invalid value for "double", must be greater than or equal to 67.8.' - end - - @double = double - end - - # Custom attribute writer method with validation - # @param [Object] string Value to be assigned - def string=(string) - pattern = Regexp.new(/[a-z]/i) - if !string.nil? && string !~ pattern - fail ArgumentError, "invalid value for \"string\", must conform to the pattern #{pattern}." - end - - @string = string - end - - # Custom attribute writer method with validation - # @param [Object] pattern_without_delimiter Value to be assigned - def pattern_without_delimiter=(pattern_without_delimiter) - if pattern_without_delimiter.nil? - fail ArgumentError, 'pattern_without_delimiter cannot be nil' - end - - pattern = Regexp.new(/^[A-Z].*/) - if pattern_without_delimiter !~ pattern - fail ArgumentError, "invalid value for \"pattern_without_delimiter\", must conform to the pattern #{pattern}." - end - - @pattern_without_delimiter = pattern_without_delimiter - end - - # Custom attribute writer method with validation - # @param [Object] password Value to be assigned - def password=(password) - if !password.nil? && password.to_s.length > 64 - fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 64.' - end - - if !password.nil? && password.to_s.length < 10 - fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.' - end - - @password = password - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - integer == o.integer && - int32 == o.int32 && - int64 == o.int64 && - number == o.number && - float == o.float && - double == o.double && - string == o.string && - pattern_without_delimiter == o.pattern_without_delimiter && - byte == o.byte && - binary == o.binary && - date == o.date && - date_time == o.date_time && - password == o.password && - callback == o.callback - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [integer, int32, int64, number, float, double, string, pattern_without_delimiter, byte, binary, date, date_time, password, callback].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb deleted file mode 100644 index 560e747ce79c..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject4 - # field1 - attr_accessor :param - - # field2 - attr_accessor :param2 - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'param' => :'param', - :'param2' => :'param2' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'param' => :'String', - :'param2' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject4` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject4`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'param') - self.param = attributes[:'param'] - end - - if attributes.key?(:'param2') - self.param2 = attributes[:'param2'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @param.nil? - invalid_properties.push('invalid value for "param", param cannot be nil.') - end - - if @param2.nil? - invalid_properties.push('invalid value for "param2", param2 cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @param.nil? - return false if @param2.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - param == o.param && - param2 == o.param2 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [param, param2].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb deleted file mode 100644 index e75bb452989a..000000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class InlineObject5 - # Additional data to pass to server - attr_accessor :additional_metadata - - # file to upload - attr_accessor :required_file - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'additional_metadata' => :'additionalMetadata', - :'required_file' => :'requiredFile' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'additional_metadata' => :'String', - :'required_file' => :'File' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::InlineObject5` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::InlineObject5`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'additional_metadata') - self.additional_metadata = attributes[:'additional_metadata'] - end - - if attributes.key?(:'required_file') - self.required_file = attributes[:'required_file'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @required_file.nil? - invalid_properties.push('invalid value for "required_file", required_file cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @required_file.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - additional_metadata == o.additional_metadata && - required_file == o.required_file - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [additional_metadata, required_file].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - Petstore.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/spec/models/inline_object1_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object1_spec.rb deleted file mode 100644 index a702fd774eac..000000000000 --- a/samples/client/petstore/ruby/spec/models/inline_object1_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject1 -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject1' do - before do - # run before each test - @instance = Petstore::InlineObject1.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject1' do - it 'should create an instance of InlineObject1' do - expect(@instance).to be_instance_of(Petstore::InlineObject1) - end - end - describe 'test attribute "additional_metadata"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "file"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/inline_object2_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object2_spec.rb deleted file mode 100644 index 7013915ea39d..000000000000 --- a/samples/client/petstore/ruby/spec/models/inline_object2_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject2 -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject2' do - before do - # run before each test - @instance = Petstore::InlineObject2.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject2' do - it 'should create an instance of InlineObject2' do - expect(@instance).to be_instance_of(Petstore::InlineObject2) - end - end - describe 'test attribute "enum_form_string_array"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', [">", "$"]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_form_string_array = value }.not_to raise_error - # end - end - end - - describe 'test attribute "enum_form_string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) - # validator.allowable_values.each do |value| - # expect { @instance.enum_form_string = value }.not_to raise_error - # end - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/inline_object3_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object3_spec.rb deleted file mode 100644 index 4daf41b4ace0..000000000000 --- a/samples/client/petstore/ruby/spec/models/inline_object3_spec.rb +++ /dev/null @@ -1,119 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject3 -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject3' do - before do - # run before each test - @instance = Petstore::InlineObject3.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject3' do - it 'should create an instance of InlineObject3' do - expect(@instance).to be_instance_of(Petstore::InlineObject3) - end - end - describe 'test attribute "integer"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "int32"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "int64"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "number"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "float"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "double"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "string"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "pattern_without_delimiter"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "byte"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "binary"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "date"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "date_time"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "callback"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/inline_object4_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object4_spec.rb deleted file mode 100644 index fa806f95860c..000000000000 --- a/samples/client/petstore/ruby/spec/models/inline_object4_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject4 -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject4' do - before do - # run before each test - @instance = Petstore::InlineObject4.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject4' do - it 'should create an instance of InlineObject4' do - expect(@instance).to be_instance_of(Petstore::InlineObject4) - end - end - describe 'test attribute "param"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "param2"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/inline_object5_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object5_spec.rb deleted file mode 100644 index e2410b21bc09..000000000000 --- a/samples/client/petstore/ruby/spec/models/inline_object5_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject5 -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject5' do - before do - # run before each test - @instance = Petstore::InlineObject5.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject5' do - it 'should create an instance of InlineObject5' do - expect(@instance).to be_instance_of(Petstore::InlineObject5) - end - end - describe 'test attribute "additional_metadata"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "required_file"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/client/petstore/ruby/spec/models/inline_object_spec.rb b/samples/client/petstore/ruby/spec/models/inline_object_spec.rb deleted file mode 100644 index c5a7db44780e..000000000000 --- a/samples/client/petstore/ruby/spec/models/inline_object_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::InlineObject -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'InlineObject' do - before do - # run before each test - @instance = Petstore::InlineObject.new - end - - after do - # run after each test - end - - describe 'test an instance of InlineObject' do - it 'should create an instance of InlineObject' do - expect(@instance).to be_instance_of(Petstore::InlineObject) - end - end - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - - describe 'test attribute "status"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - -end diff --git a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION index c3a2c7076fa8..d99e7162d01f 100644 --- a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index c37c1641f024..defb23afd922 100755 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -46,7 +46,7 @@ const docusaurusConfig = { }, links: [ - {to: 'docs/installation', label: 'Install'}, + {to: 'docs/installation', label: 'Getting Started'}, {to: 'docs/generators', label: 'Generators'}, {to: 'docs/roadmap', label: 'Roadmap'}, {to: "docs/faq", label: "FAQ" }, diff --git a/website/sidebars.js b/website/sidebars.js index 3c715231a70f..0880123d523c 100755 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -5,7 +5,8 @@ module.exports = { 'installation', 'plugins', 'online', - 'usage' + 'usage', + 'globals' ], 'Extending': [ 'templating', From 54e25740130fe01ee38bb53a31b5b0e2c0d73e91 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sun, 31 May 2020 07:45:01 -0700 Subject: [PATCH 02/12] [Java][Jersey2] Fix typo and script, Log enhancements, HTTP signature, deserialization (#6476) * Mustache template should use invokerPackage tag to generate import * fix typo, fix script issue, add log statement for troubleshooting * Add java jersey2 samples with OpenAPI doc that has HTTP signature security scheme * Add sample for Java jersey2 and HTTP signature scheme * Add unit test for oneOf schema deserialization * Add unit test for oneOf schema deserialization * Add log statements * Add profile for jersey2 * Temporarily disable unit test * Temporarily disable unit test * fix typo in pom.xml * fix duplicate jersey2 samples * fix duplicate jersey2 samples * fix duplicate artifact id * fix duplicate jersey2 samples * run samples scripts --- .../jersey2-java8/JSONComposedSchemaTest.java | 68 + bin/java-petstore-jersey2-java8.sh | 6 +- bin/openapi3/java-petstore-jersey2-java8.json | 5 + bin/openapi3/java-petstore-jersey2-java8.sh | 44 + bin/utils/ensure-up-to-date | 1 + .../Java/libraries/jersey2/ApiClient.mustache | 9 +- .../libraries/jersey2/anyof_model.mustache | 7 +- .../jersey2/auth/HttpSignatureAuth.mustache | 3 +- .../libraries/jersey2/oneof_model.mustache | 6 + pom.xml | 13 + .../org/openapitools/client/ApiClient.java | 9 +- .../petstore/java/jersey2-java8/.gitignore | 21 + .../jersey2-java8/.openapi-generator-ignore | 23 + .../jersey2-java8/.openapi-generator/FILES | 204 ++ .../jersey2-java8/.openapi-generator/VERSION | 1 + .../petstore/java/jersey2-java8/.travis.yml | 22 + .../petstore/java/jersey2-java8/README.md | 281 ++ .../java/jersey2-java8/api/openapi.yaml | 2398 +++++++++++++++++ .../petstore/java/jersey2-java8/build.gradle | 125 + .../petstore/java/jersey2-java8/build.sbt | 25 + .../docs/AdditionalPropertiesClass.md | 19 + .../java/jersey2-java8/docs/Animal.md | 13 + .../java/jersey2-java8/docs/AnotherFakeApi.md | 74 + .../petstore/java/jersey2-java8/docs/Apple.md | 13 + .../java/jersey2-java8/docs/AppleReq.md | 13 + .../docs/ArrayOfArrayOfNumberOnly.md | 12 + .../jersey2-java8/docs/ArrayOfNumberOnly.md | 12 + .../java/jersey2-java8/docs/ArrayTest.md | 14 + .../java/jersey2-java8/docs/Banana.md | 12 + .../java/jersey2-java8/docs/BananaReq.md | 13 + .../java/jersey2-java8/docs/BasquePig.md | 12 + .../java/jersey2-java8/docs/Capitalization.md | 17 + .../petstore/java/jersey2-java8/docs/Cat.md | 12 + .../java/jersey2-java8/docs/CatAllOf.md | 12 + .../java/jersey2-java8/docs/Category.md | 13 + .../java/jersey2-java8/docs/ChildCat.md | 12 + .../java/jersey2-java8/docs/ChildCatAllOf.md | 12 + .../java/jersey2-java8/docs/ClassModel.md | 13 + .../java/jersey2-java8/docs/Client.md | 12 + .../docs/ComplexQuadrilateral.md | 13 + .../java/jersey2-java8/docs/DanishPig.md | 12 + .../java/jersey2-java8/docs/DefaultApi.md | 68 + .../petstore/java/jersey2-java8/docs/Dog.md | 12 + .../java/jersey2-java8/docs/DogAllOf.md | 12 + .../java/jersey2-java8/docs/Drawing.md | 15 + .../java/jersey2-java8/docs/EnumArrays.md | 31 + .../java/jersey2-java8/docs/EnumClass.md | 15 + .../java/jersey2-java8/docs/EnumTest.md | 57 + .../jersey2-java8/docs/EquilateralTriangle.md | 13 + .../java/jersey2-java8/docs/FakeApi.md | 998 +++++++ .../docs/FakeClassnameTags123Api.md | 81 + .../jersey2-java8/docs/FileSchemaTestClass.md | 13 + .../petstore/java/jersey2-java8/docs/Foo.md | 12 + .../java/jersey2-java8/docs/FormatTest.md | 26 + .../petstore/java/jersey2-java8/docs/Fruit.md | 15 + .../java/jersey2-java8/docs/FruitReq.md | 15 + .../java/jersey2-java8/docs/GmFruit.md | 15 + .../jersey2-java8/docs/GrandparentAnimal.md | 12 + .../jersey2-java8/docs/HasOnlyReadOnly.md | 13 + .../jersey2-java8/docs/HealthCheckResult.md | 13 + .../java/jersey2-java8/docs/InlineObject.md | 13 + .../java/jersey2-java8/docs/InlineObject1.md | 13 + .../java/jersey2-java8/docs/InlineObject2.md | 32 + .../java/jersey2-java8/docs/InlineObject3.md | 25 + .../java/jersey2-java8/docs/InlineObject4.md | 13 + .../java/jersey2-java8/docs/InlineObject5.md | 13 + .../docs/InlineResponseDefault.md | 12 + .../jersey2-java8/docs/IsoscelesTriangle.md | 13 + .../java/jersey2-java8/docs/Mammal.md | 25 + .../java/jersey2-java8/docs/MapTest.md | 24 + ...dPropertiesAndAdditionalPropertiesClass.md | 14 + .../jersey2-java8/docs/Model200Response.md | 14 + .../jersey2-java8/docs/ModelApiResponse.md | 14 + .../java/jersey2-java8/docs/ModelReturn.md | 13 + .../petstore/java/jersey2-java8/docs/Name.md | 16 + .../java/jersey2-java8/docs/NullableClass.md | 23 + .../java/jersey2-java8/docs/NullableShape.md | 14 + .../java/jersey2-java8/docs/NumberOnly.md | 12 + .../petstore/java/jersey2-java8/docs/Order.md | 27 + .../java/jersey2-java8/docs/OuterComposite.md | 14 + .../java/jersey2-java8/docs/OuterEnum.md | 15 + .../docs/OuterEnumDefaultValue.md | 15 + .../jersey2-java8/docs/OuterEnumInteger.md | 15 + .../docs/OuterEnumIntegerDefaultValue.md | 15 + .../java/jersey2-java8/docs/ParentPet.md | 11 + .../petstore/java/jersey2-java8/docs/Pet.md | 27 + .../java/jersey2-java8/docs/PetApi.md | 657 +++++ .../petstore/java/jersey2-java8/docs/Pig.md | 12 + .../java/jersey2-java8/docs/Quadrilateral.md | 13 + .../docs/QuadrilateralInterface.md | 12 + .../java/jersey2-java8/docs/ReadOnlyFirst.md | 13 + .../jersey2-java8/docs/ScaleneTriangle.md | 13 + .../petstore/java/jersey2-java8/docs/Shape.md | 13 + .../java/jersey2-java8/docs/ShapeInterface.md | 12 + .../java/jersey2-java8/docs/ShapeOrNull.md | 14 + .../jersey2-java8/docs/SimpleQuadrilateral.md | 13 + .../jersey2-java8/docs/SpecialModelName.md | 12 + .../java/jersey2-java8/docs/StoreApi.md | 276 ++ .../petstore/java/jersey2-java8/docs/Tag.md | 13 + .../java/jersey2-java8/docs/Triangle.md | 13 + .../jersey2-java8/docs/TriangleInterface.md | 12 + .../petstore/java/jersey2-java8/docs/User.md | 23 + .../java/jersey2-java8/docs/UserApi.md | 525 ++++ .../petstore/java/jersey2-java8/docs/Whale.md | 14 + .../petstore/java/jersey2-java8/docs/Zebra.md | 23 + .../petstore/java/jersey2-java8/git_push.sh | 58 + .../java/jersey2-java8/gradle.properties | 2 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 99814 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + .../petstore/java/jersey2-java8/gradlew | 183 ++ .../petstore/java/jersey2-java8/gradlew.bat | 100 + .../petstore/java/jersey2-java8/pom.xml | 305 +++ .../java/jersey2-java8/settings.gradle | 1 + .../src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiClient.java | 1287 +++++++++ .../org/openapitools/client/ApiException.java | 94 + .../org/openapitools/client/ApiResponse.java | 74 + .../openapitools/client/Configuration.java | 39 + .../java/org/openapitools/client/JSON.java | 49 + .../java/org/openapitools/client/Pair.java | 61 + .../client/RFC3339DateFormat.java | 32 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../client/api/AnotherFakeApi.java | 115 + .../openapitools/client/api/DefaultApi.java | 108 + .../org/openapitools/client/api/FakeApi.java | 1196 ++++++++ .../client/api/FakeClassnameTags123Api.java | 115 + .../org/openapitools/client/api/PetApi.java | 697 +++++ .../org/openapitools/client/api/StoreApi.java | 316 +++ .../org/openapitools/client/api/UserApi.java | 588 ++++ .../openapitools/client/auth/ApiKeyAuth.java | 79 + .../client/auth/Authentication.java | 33 + .../client/auth/HttpBasicAuth.java | 56 + .../client/auth/HttpBearerAuth.java | 62 + .../client/auth/HttpSignatureAuth.java | 265 ++ .../org/openapitools/client/auth/OAuth.java | 183 ++ .../openapitools/client/auth/OAuthFlow.java | 18 + .../client/model/AbstractOpenApiSchema.java | 127 + .../model/AdditionalPropertiesClass.java | 367 +++ .../org/openapitools/client/model/Animal.java | 142 + .../org/openapitools/client/model/Apple.java | 133 + .../openapitools/client/model/AppleReq.java | 132 + .../model/ArrayOfArrayOfNumberOnly.java | 113 + .../client/model/ArrayOfNumberOnly.java | 113 + .../openapitools/client/model/ArrayTest.java | 191 ++ .../org/openapitools/client/model/Banana.java | 103 + .../openapitools/client/model/BananaReq.java | 133 + .../openapitools/client/model/BasquePig.java | 101 + .../client/model/Capitalization.java | 257 ++ .../org/openapitools/client/model/Cat.java | 112 + .../openapitools/client/model/CatAllOf.java | 102 + .../openapitools/client/model/Category.java | 132 + .../openapitools/client/model/ChildCat.java | 112 + .../client/model/ChildCatAllOf.java | 102 + .../openapitools/client/model/ClassModel.java | 103 + .../org/openapitools/client/model/Client.java | 102 + .../client/model/ComplexQuadrilateral.java | 133 + .../openapitools/client/model/DanishPig.java | 101 + .../org/openapitools/client/model/Dog.java | 112 + .../openapitools/client/model/DogAllOf.java | 102 + .../openapitools/client/model/Drawing.java | 226 ++ .../openapitools/client/model/EnumArrays.java | 213 ++ .../openapitools/client/model/EnumClass.java | 60 + .../openapitools/client/model/EnumTest.java | 479 ++++ .../client/model/EquilateralTriangle.java | 133 + .../client/model/FileSchemaTestClass.java | 143 + .../org/openapitools/client/model/Foo.java | 102 + .../openapitools/client/model/FormatTest.java | 547 ++++ .../org/openapitools/client/model/Fruit.java | 141 + .../openapitools/client/model/FruitReq.java | 141 + .../openapitools/client/model/GmFruit.java | 134 + .../client/model/GrandparentAnimal.java | 111 + .../client/model/HasOnlyReadOnly.java | 115 + .../client/model/HealthCheckResult.java | 116 + .../client/model/InlineObject.java | 133 + .../client/model/InlineObject1.java | 134 + .../client/model/InlineObject2.java | 215 ++ .../client/model/InlineObject3.java | 514 ++++ .../client/model/InlineObject4.java | 131 + .../client/model/InlineObject5.java | 133 + .../client/model/InlineResponseDefault.java | 103 + .../client/model/IsoscelesTriangle.java | 133 + .../org/openapitools/client/model/Mammal.java | 165 ++ .../openapitools/client/model/MapTest.java | 265 ++ ...ropertiesAndAdditionalPropertiesClass.java | 178 ++ .../client/model/Model200Response.java | 134 + .../client/model/ModelApiResponse.java | 164 ++ .../client/model/ModelReturn.java | 103 + .../org/openapitools/client/model/Name.java | 177 ++ .../client/model/NullableClass.java | 619 +++++ .../client/model/NullableShape.java | 142 + .../openapitools/client/model/NumberOnly.java | 103 + .../org/openapitools/client/model/Order.java | 295 ++ .../client/model/OuterComposite.java | 165 ++ .../openapitools/client/model/OuterEnum.java | 60 + .../client/model/OuterEnumDefaultValue.java | 60 + .../client/model/OuterEnumInteger.java | 60 + .../model/OuterEnumIntegerDefaultValue.java | 60 + .../openapitools/client/model/ParentPet.java | 81 + .../org/openapitools/client/model/Pet.java | 309 +++ .../org/openapitools/client/model/Pig.java | 142 + .../client/model/Quadrilateral.java | 142 + .../client/model/QuadrilateralInterface.java | 101 + .../client/model/ReadOnlyFirst.java | 124 + .../client/model/ScaleneTriangle.java | 133 + .../org/openapitools/client/model/Shape.java | 142 + .../client/model/ShapeInterface.java | 101 + .../client/model/ShapeOrNull.java | 142 + .../client/model/SimpleQuadrilateral.java | 133 + .../client/model/SpecialModelName.java | 102 + .../org/openapitools/client/model/Tag.java | 133 + .../openapitools/client/model/Triangle.java | 165 ++ .../client/model/TriangleInterface.java | 101 + .../org/openapitools/client/model/User.java | 476 ++++ .../org/openapitools/client/model/Whale.java | 163 ++ .../org/openapitools/client/model/Zebra.java | 173 ++ .../client/JSONComposedSchemaTest.java | 68 + .../org/openapitools/client/JSONTest.java | 45 + .../client/api/AnotherFakeApiTest.java | 50 + .../client/api/DefaultApiTest.java | 49 + .../openapitools/client/api/FakeApiTest.java | 290 ++ .../api/FakeClassnameTags123ApiTest.java | 50 + .../openapitools/client/api/PetApiTest.java | 179 ++ .../openapitools/client/api/StoreApiTest.java | 94 + .../openapitools/client/api/UserApiTest.java | 156 ++ .../model/AdditionalPropertiesClassTest.java | 111 + .../openapitools/client/model/AnimalTest.java | 61 + .../client/model/AppleReqTest.java | 57 + .../openapitools/client/model/AppleTest.java | 57 + .../model/ArrayOfArrayOfNumberOnlyTest.java | 52 + .../client/model/ArrayOfNumberOnlyTest.java | 52 + .../client/model/ArrayTestTest.java | 68 + .../client/model/BananaReqTest.java | 58 + .../openapitools/client/model/BananaTest.java | 50 + .../client/model/BasquePigTest.java | 49 + .../client/model/CapitalizationTest.java | 89 + .../client/model/CatAllOfTest.java | 49 + .../openapitools/client/model/CatTest.java | 69 + .../client/model/CategoryTest.java | 57 + .../client/model/ChildCatAllOfTest.java | 49 + .../client/model/ChildCatTest.java | 61 + .../client/model/ClassModelTest.java | 49 + .../openapitools/client/model/ClientTest.java | 49 + .../model/ComplexQuadrilateralTest.java | 59 + .../client/model/DanishPigTest.java | 49 + .../client/model/DogAllOfTest.java | 49 + .../openapitools/client/model/DogTest.java | 69 + .../client/model/DrawingTest.java | 84 + .../client/model/EnumArraysTest.java | 59 + .../client/model/EnumClassTest.java | 33 + .../client/model/EnumTestTest.java | 112 + .../client/model/EquilateralTriangleTest.java | 59 + .../client/model/FileSchemaTestClassTest.java | 59 + .../openapitools/client/model/FooTest.java | 49 + .../client/model/FormatTestTest.java | 166 ++ .../client/model/FruitReqTest.java | 76 + .../openapitools/client/model/FruitTest.java | 68 + .../client/model/GmFruitTest.java | 68 + .../client/model/GrandparentAnimalTest.java | 53 + .../client/model/HasOnlyReadOnlyTest.java | 57 + .../client/model/HealthCheckResultTest.java | 52 + .../client/model/InlineObject1Test.java | 58 + .../client/model/InlineObject2Test.java | 59 + .../client/model/InlineObject3Test.java | 157 ++ .../client/model/InlineObject4Test.java | 57 + .../client/model/InlineObject5Test.java | 58 + .../client/model/InlineObjectTest.java | 57 + .../model/InlineResponseDefaultTest.java | 50 + .../client/model/IsoscelesTriangleTest.java | 59 + .../openapitools/client/model/MammalTest.java | 78 + .../client/model/MapTestTest.java | 76 + ...rtiesAndAdditionalPropertiesClassTest.java | 71 + .../client/model/Model200ResponseTest.java | 57 + .../client/model/ModelApiResponseTest.java | 65 + .../client/model/ModelReturnTest.java | 49 + .../openapitools/client/model/NameTest.java | 73 + .../client/model/NullableClassTest.java | 147 + .../client/model/NullableShapeTest.java | 69 + .../client/model/NumberOnlyTest.java | 50 + .../openapitools/client/model/OrderTest.java | 90 + .../client/model/OuterCompositeTest.java | 66 + .../model/OuterEnumDefaultValueTest.java | 33 + .../OuterEnumIntegerDefaultValueTest.java | 33 + .../client/model/OuterEnumIntegerTest.java | 33 + .../client/model/OuterEnumTest.java | 33 + .../client/model/ParentPetTest.java | 53 + .../openapitools/client/model/PetTest.java | 93 + .../openapitools/client/model/PigTest.java | 53 + .../model/QuadrilateralInterfaceTest.java | 49 + .../client/model/QuadrilateralTest.java | 61 + .../client/model/ReadOnlyFirstTest.java | 57 + .../client/model/ScaleneTriangleTest.java | 59 + .../client/model/ShapeInterfaceTest.java | 49 + .../client/model/ShapeOrNullTest.java | 69 + .../openapitools/client/model/ShapeTest.java | 69 + .../client/model/SimpleQuadrilateralTest.java | 59 + .../client/model/SpecialModelNameTest.java | 49 + .../openapitools/client/model/TagTest.java | 57 + .../client/model/TriangleInterfaceTest.java | 49 + .../client/model/TriangleTest.java | 62 + .../openapitools/client/model/UserTest.java | 140 + .../openapitools/client/model/WhaleTest.java | 65 + .../openapitools/client/model/ZebraTest.java | 59 + 304 files changed, 32362 insertions(+), 7 deletions(-) create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java create mode 100644 bin/openapi3/java-petstore-jersey2-java8.json create mode 100755 bin/openapi3/java-petstore-jersey2-java8.sh create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/.gitignore create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/.travis.yml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/README.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/build.gradle create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/build.sbt create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Apple.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/AppleReq.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Banana.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/BananaReq.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/BasquePig.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Category.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCatAllOf.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Client.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ComplexQuadrilateral.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/DanishPig.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Drawing.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/EquilateralTriangle.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Fruit.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/FruitReq.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/GmFruit.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/GrandparentAnimal.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject1.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject2.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject3.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject4.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject5.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/IsoscelesTriangle.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Mammal.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Model200Response.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelApiResponse.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Name.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/NullableShape.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Order.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ParentPet.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Pig.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Quadrilateral.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/QuadrilateralInterface.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ScaleneTriangle.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Shape.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ShapeInterface.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ShapeOrNull.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/SimpleQuadrilateral.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Triangle.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/TriangleInterface.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/User.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Whale.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/Zebra.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/git_push.sh create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/gradle.properties create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/gradlew create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/gradlew.bat create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/pom.xml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/settings.gradle create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/AndroidManifest.xml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiException.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/Configuration.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/Pair.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuthFlow.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject1.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject2.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject3.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject4.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject5.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeApiTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/StoreApiTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/UserApiTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AnimalTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AppleReqTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AppleTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayTestTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BananaReqTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BananaTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BasquePigTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CapitalizationTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CatAllOfTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CatTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CategoryTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ChildCatAllOfTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ChildCatTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ClassModelTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ClientTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DanishPigTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DogAllOfTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DogTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DrawingTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumArraysTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumClassTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumTestTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FooTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FormatTestTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FruitReqTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FruitTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/GmFruitTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject1Test.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject2Test.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject3Test.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject4Test.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject5Test.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObjectTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MammalTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MapTestTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/Model200ResponseTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelReturnTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NameTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NullableClassTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NullableShapeTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NumberOnlyTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OrderTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterCompositeTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ParentPetTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/PetTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/PigTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/QuadrilateralTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TagTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TriangleTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/UserTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/WhaleTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ZebraTest.java diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java new file mode 100644 index 000000000000..89227f3d252c --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java @@ -0,0 +1,68 @@ +package org.openapitools.client; + +import org.openapitools.client.model.Mammal; +import org.openapitools.client.model.AppleReq; +import org.openapitools.client.model.BananaReq; +import org.openapitools.client.model.FruitReq; +import org.openapitools.client.model.BasquePig; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; +import java.lang.Exception; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class JSONComposedSchemaTest { + JSON json = null; + Mammal mammal = null; + + @Before + public void setup() { + json = new JSON(); + mammal = new Mammal(); + } + + /** + * Validate a oneOf schema can be deserialized into the expected class. + * The oneOf schema does not have a discriminator. + */ + @Test + public void testOneOfSchemaWithoutDiscriminator() throws Exception { + // BananaReq and AppleReq have explicitly defined properties that are different by name. + // There is no discriminator property. + String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false }"; + FruitReq o = json.getContext(null).readValue(str, FruitReq.class); + assertTrue(o.getActualInstance() instanceof AppleReq); + } + + /** + * Validate a oneOf schema can be deserialized into the expected class. + * The oneOf schema has a discriminator. + */ + @Test + public void testOneOfSchemaWithDiscriminator() throws Exception { + // Mammal can be one of whale, pig and zebra. + // pig has sub-classes. + String str = "{ \"className\": \"whale\", \"hasBaleen\": true, \"hasTeeth\": false }"; + /* + DISABLING unit test for now until ambiguity of discriminator is resolved. + + // Note that the 'zebra' schema does not have any explicit property defined AND + // it has additionalProperties: true. Hence without a discriminator the above + // JSON payload would match both 'whale' and 'zebra'. This is because the 'hasBaleen' + // and 'hasTeeth' would be considered additional (undeclared) properties for 'zebra'. + Mammal o = json.getContext(null).readValue(str, Mammal.class); + assertTrue(o.getActualInstance() instanceof Whale); + + str = "{ \"className\": \"zebra\" }"; + o = json.getContext(null).readValue(str, Mammal.class); + assertTrue(o.getActualInstance() instanceof Zebra); + + str = "{ \"className\": \"BasquePig\" }"; + o = json.getContext(null).readValue(str, Mammal.class); + assertTrue(o.getActualInstance() instanceof BasquePig); + */ + } +} \ No newline at end of file diff --git a/bin/java-petstore-jersey2-java8.sh b/bin/java-petstore-jersey2-java8.sh index 3cacd238399a..d964032cf076 100755 --- a/bin/java-petstore-jersey2-java8.sh +++ b/bin/java-petstore-jersey2-java8.sh @@ -35,9 +35,9 @@ find samples/client/petstore/java/jersey2-java8 -maxdepth 1 -type f ! -name "REA java $JAVA_OPTS -jar $executable $ags # copy additional manually written unit-tests -mkdir samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client -mkdir samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth -mkdir samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model +mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client +mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth +mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/StringUtilTest.java cp CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java diff --git a/bin/openapi3/java-petstore-jersey2-java8.json b/bin/openapi3/java-petstore-jersey2-java8.json new file mode 100644 index 000000000000..dd2a70a3c328 --- /dev/null +++ b/bin/openapi3/java-petstore-jersey2-java8.json @@ -0,0 +1,5 @@ +{ + "library": "jersey2", + "artifactId": "petstore-openapi3-jersey2-java8", + "dateLibrary": "java8" +} diff --git a/bin/openapi3/java-petstore-jersey2-java8.sh b/bin/openapi3/java-petstore-jersey2-java8.sh new file mode 100755 index 000000000000..8eb4da0f944f --- /dev/null +++ b/bin/openapi3/java-petstore-jersey2-java8.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +yaml="modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml" +ags="generate --artifact-id petstore-openapi3-jersey2-java8 -i $yaml -g java -c bin/openapi3/java-petstore-jersey2-java8.json -o samples/openapi3/client/petstore/java/jersey2-java8 --additional-properties hideGenerationTimestamp=true --additional-properties serverPort=8082 $@" + +echo "Removing files and folders under samples/openapi3/client/petstore/java/jersey2-java8/src/main" +rm -rf samples/openapi3/client/petstore/java/jersey2-java8/src/main +find samples/openapi3/client/petstore/java/jersey2-java8 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + +java $JAVA_OPTS -jar $executable $ags + +# copy additional manually written unit-tests +mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client +mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth +mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model + +cp CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index ea74226e31f1..42111834d7c7 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -40,6 +40,7 @@ declare -a samples=( "${root}/bin/python-server-all.sh" "${root}/bin/openapi3/python-petstore.sh" "${root}/bin/openapi3/python-experimental-petstore.sh" +"${root}/bin/openapi3/java-petstore-jersey2-java8.sh" "${root}/bin/php-petstore.sh" "${root}/bin/php-silex-petstore-server.sh" "${root}/bin/php-symfony-petstore.sh" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 8d12c42630d1..d6ff3f94e0bd 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -36,6 +36,8 @@ import org.glassfish.jersey.logging.LoggingFeature; import org.apache.commons.io.FileUtils; import org.glassfish.jersey.filter.LoggingFilter; {{/supportJava6}} +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.Collection; import java.util.Collections; import java.util.Map; @@ -73,6 +75,8 @@ public class ApiClient { protected Map defaultHeaderMap = new HashMap(); protected Map defaultCookieMap = new HashMap(); protected String basePath = "{{{basePath}}}"; + private static final Logger log = Logger.getLogger(ApiClient.class.getName()); + protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList( {{/-first}} new ServerConfiguration( "{{{url}}}", @@ -928,6 +932,9 @@ public class ApiClient { } } catch (Exception ex) { // failed to deserialize, do nothing and try next one (schema) + // Logging the error may be useful to troubleshoot why a payload fails to match + // the schema. + log.log(Level.FINE, "Input data does not match schema '" + schemaName + "'", ex); } } else {// unknown type throw new ApiException(schemaType.getClass() + " is not a GenericType and cannot be handled properly in deserialization."); @@ -938,7 +945,7 @@ public class ApiClient { if (matchCounter > 1 && "oneOf".equals(schema.getSchemaType())) {// more than 1 match for oneOf throw new ApiException("Response body is invalid as it matches more than one schema (" + StringUtil.join(matchSchemas, ", ") + ") defined in the oneOf model: " + schema.getClass().getName()); } else if (matchCounter == 0) { // fail to match any in oneOf/anyOf schemas - throw new ApiException("Response body is invalid as it doens't match any schemas (" + StringUtil.join(schema.getSchemas().keySet(), ", ") + ") defined in the oneOf/anyOf model: " + schema.getClass().getName()); + throw new ApiException("Response body is invalid as it does not match any schemas (" + StringUtil.join(schema.getSchemas().keySet(), ", ") + ") defined in the oneOf/anyOf model: " + schema.getClass().getName()); } else { // only one matched schema.setActualInstance(result); return schema; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache index f5d76fed53b7..5c3219b5de37 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/anyof_model.mustache @@ -1,6 +1,8 @@ import javax.ws.rs.core.GenericType; import javax.ws.rs.core.Response; import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -15,6 +17,8 @@ import com.fasterxml.jackson.databind.deser.std.StdDeserializer; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + public static class {{classname}}Deserializer extends StdDeserializer<{{classname}}> { public {{classname}}Deserializer() { this({{classname}}.class); @@ -37,7 +41,8 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im ret.setActualInstance(deserialized); return ret; } catch (Exception e) { - // deserialization failed, continue + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match '{{classname}}'", e); } {{/anyOf}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache index 3e1c0f0e7f71..c978de46a0f6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache @@ -17,6 +17,7 @@ import java.util.Locale; import java.util.Map; import java.util.List; import java.security.spec.AlgorithmParameterSpec; +import java.security.InvalidKeyException; import org.tomitribe.auth.signatures.Algorithm; import org.tomitribe.auth.signatures.Signer; @@ -204,7 +205,7 @@ public class HttpSignatureAuth implements Authentication { * @throws InvalidKeyException Unable to parse the key, or the security provider for this key * is not installed. */ - public void setPrivateKey(Key key) throws InvalidKeyException { + public void setPrivateKey(Key key) throws InvalidKeyException, ApiException { if (key == null) { throw new ApiException("Private key (java.security.Key) cannot be null"); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache index b7523272c00f..fec28f2e2dce 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache @@ -1,6 +1,8 @@ import javax.ws.rs.core.GenericType; import javax.ws.rs.core.Response; import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -15,6 +17,8 @@ import com.fasterxml.jackson.databind.deser.std.StdDeserializer; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + public static class {{classname}}Deserializer extends StdDeserializer<{{classname}}> { public {{classname}}Deserializer() { this({{classname}}.class); @@ -35,8 +39,10 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im try { deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); match++; + log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); } catch (Exception e) { // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); } {{/oneOf}} diff --git a/pom.xml b/pom.xml index 20562772d132..9a6a76e3cd77 100644 --- a/pom.xml +++ b/pom.xml @@ -703,6 +703,18 @@ samples/client/petstore/java/jersey2-java8 + + java-client-openapi3-jersey2-java8 + + + env + java + + + + samples/openapi3/client/petstore/java/jersey2-java8 + + java-client-okhttp-gson @@ -1252,6 +1264,7 @@ samples/client/petstore/java/feign10x samples/client/petstore/java/jersey1 samples/client/petstore/java/jersey2-java8 + samples/openapi3/client/petstore/java/jersey2-java8 samples/client/petstore/java/okhttp-gson samples/client/petstore/java/retrofit2 samples/client/petstore/java/retrofit2rx diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index a4ebc69f5678..0755459fc431 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -28,6 +28,8 @@ import java.nio.file.Files; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.Collection; import java.util.Collections; import java.util.Map; @@ -60,6 +62,8 @@ public class ApiClient { protected Map defaultHeaderMap = new HashMap(); protected Map defaultCookieMap = new HashMap(); protected String basePath = "http://petstore.swagger.io:80/v2"; + private static final Logger log = Logger.getLogger(ApiClient.class.getName()); + protected List servers = new ArrayList(Arrays.asList( new ServerConfiguration( "http://petstore.swagger.io:80/v2", @@ -845,6 +849,9 @@ public AbstractOpenApiSchema deserializeSchemas(Response response, AbstractOpenA } } catch (Exception ex) { // failed to deserialize, do nothing and try next one (schema) + // Logging the error may be useful to troubleshoot why a payload fails to match + // the schema. + log.log(Level.FINE, "Input data does not match schema '" + schemaName + "'", ex); } } else {// unknown type throw new ApiException(schemaType.getClass() + " is not a GenericType and cannot be handled properly in deserialization."); @@ -855,7 +862,7 @@ public AbstractOpenApiSchema deserializeSchemas(Response response, AbstractOpenA if (matchCounter > 1 && "oneOf".equals(schema.getSchemaType())) {// more than 1 match for oneOf throw new ApiException("Response body is invalid as it matches more than one schema (" + StringUtil.join(matchSchemas, ", ") + ") defined in the oneOf model: " + schema.getClass().getName()); } else if (matchCounter == 0) { // fail to match any in oneOf/anyOf schemas - throw new ApiException("Response body is invalid as it doens't match any schemas (" + StringUtil.join(schema.getSchemas().keySet(), ", ") + ") defined in the oneOf/anyOf model: " + schema.getClass().getName()); + throw new ApiException("Response body is invalid as it does not match any schemas (" + StringUtil.join(schema.getSchemas().keySet(), ", ") + ") defined in the oneOf/anyOf model: " + schema.getClass().getName()); } else { // only one matched schema.setActualInstance(result); return schema; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.gitignore b/samples/openapi3/client/petstore/java/jersey2-java8/.gitignore new file mode 100644 index 000000000000..a530464afa1b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator-ignore b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES new file mode 100644 index 000000000000..b82bd6a172de --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/FILES @@ -0,0 +1,204 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/Apple.md +docs/AppleReq.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Banana.md +docs/BananaReq.md +docs/BasquePig.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ChildCat.md +docs/ChildCatAllOf.md +docs/ClassModel.md +docs/Client.md +docs/ComplexQuadrilateral.md +docs/DanishPig.md +docs/DefaultApi.md +docs/Dog.md +docs/DogAllOf.md +docs/Drawing.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/EquilateralTriangle.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/GrandparentAnimal.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md +docs/InlineResponseDefault.md +docs/IsoscelesTriangle.md +docs/Mammal.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NullableShape.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/ParentPet.md +docs/Pet.md +docs/PetApi.md +docs/Pig.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md +docs/ReadOnlyFirst.md +docs/ScaleneTriangle.md +docs/Shape.md +docs/ShapeInterface.md +docs/ShapeOrNull.md +docs/SimpleQuadrilateral.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/Triangle.md +docs/TriangleInterface.md +docs/User.md +docs/UserApi.md +docs/Whale.md +docs/Zebra.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/Apple.java +src/main/java/org/openapitools/client/model/AppleReq.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/Banana.java +src/main/java/org/openapitools/client/model/BananaReq.java +src/main/java/org/openapitools/client/model/BasquePig.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ChildCat.java +src/main/java/org/openapitools/client/model/ChildCatAllOf.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +src/main/java/org/openapitools/client/model/DanishPig.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/Drawing.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/EquilateralTriangle.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/Fruit.java +src/main/java/org/openapitools/client/model/FruitReq.java +src/main/java/org/openapitools/client/model/GmFruit.java +src/main/java/org/openapitools/client/model/GrandparentAnimal.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/InlineObject.java +src/main/java/org/openapitools/client/model/InlineObject1.java +src/main/java/org/openapitools/client/model/InlineObject2.java +src/main/java/org/openapitools/client/model/InlineObject3.java +src/main/java/org/openapitools/client/model/InlineObject4.java +src/main/java/org/openapitools/client/model/InlineObject5.java +src/main/java/org/openapitools/client/model/InlineResponseDefault.java +src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +src/main/java/org/openapitools/client/model/Mammal.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NullableShape.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/client/model/OuterEnumInteger.java +src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/client/model/ParentPet.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/Pig.java +src/main/java/org/openapitools/client/model/Quadrilateral.java +src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/ScaleneTriangle.java +src/main/java/org/openapitools/client/model/Shape.java +src/main/java/org/openapitools/client/model/ShapeInterface.java +src/main/java/org/openapitools/client/model/ShapeOrNull.java +src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/Triangle.java +src/main/java/org/openapitools/client/model/TriangleInterface.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/Whale.java +src/main/java/org/openapitools/client/model/Zebra.java diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.travis.yml b/samples/openapi3/client/petstore/java/jersey2-java8/.travis.yml new file mode 100644 index 000000000000..e3bdf2af1bea --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/README.md b/samples/openapi3/client/petstore/java/jersey2-java8/README.md new file mode 100644 index 000000000000..fed6ba75e3de --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/README.md @@ -0,0 +1,281 @@ +# petstore-openapi3-jersey2-java8 + +OpenAPI Petstore + +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 1.8+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + petstore-openapi3-jersey2-java8 + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "org.openapitools:petstore-openapi3-jersey2-java8:1.0.0" +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/petstore-openapi3-jersey2-java8-1.0.0.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class AnotherFakeApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [Apple](docs/Apple.md) + - [AppleReq](docs/AppleReq.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Banana](docs/Banana.md) + - [BananaReq](docs/BananaReq.md) + - [BasquePig](docs/BasquePig.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ChildCat](docs/ChildCat.md) + - [ChildCatAllOf](docs/ChildCatAllOf.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [DanishPig](docs/DanishPig.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [Drawing](docs/Drawing.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [EquilateralTriangle](docs/EquilateralTriangle.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FormatTest](docs/FormatTest.md) + - [Fruit](docs/Fruit.md) + - [FruitReq](docs/FruitReq.md) + - [GmFruit](docs/GmFruit.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + - [IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [Mammal](docs/Mammal.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NullableShape](docs/NullableShape.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [ParentPet](docs/ParentPet.md) + - [Pet](docs/Pet.md) + - [Pig](docs/Pig.md) + - [Quadrilateral](docs/Quadrilateral.md) + - [QuadrilateralInterface](docs/QuadrilateralInterface.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [ScaleneTriangle](docs/ScaleneTriangle.md) + - [Shape](docs/Shape.md) + - [ShapeInterface](docs/ShapeInterface.md) + - [ShapeOrNull](docs/ShapeOrNull.md) + - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [Triangle](docs/Triangle.md) + - [TriangleInterface](docs/TriangleInterface.md) + - [User](docs/User.md) + - [Whale](docs/Whale.md) + - [Zebra](docs/Zebra.md) + + +## Documentation for Authorization + +Authentication schemes defined for the API: +### api_key + + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### api_key_query + + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### bearer_test + + +- **Type**: HTTP basic authentication + +### http_basic_test + + +- **Type**: HTTP basic authentication + +### http_signature_test + + +- **Type**: HTTP basic authentication + +### petstore_auth + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml new file mode 100644 index 000000000000..b254bf2c4b1e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -0,0 +1,2398 @@ +openapi: 3.0.0 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: http://{server}.swagger.io:{port}/v2 + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: https://localhost:8080/{version} + variables: + version: + default: v2 + enum: + - v1 + - v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_default' + description: response + x-accepts: application/json + /pet: + post: + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-contentType: application/json + x-accepts: application/json + put: + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-contentType: application/json + x-accepts: application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object' + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_1' + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + /store/order: + post: + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-contentType: application/json + x-accepts: application/json + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-contentType: application/json + x-accepts: application/json + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-contentType: application/json + x-accepts: application/json + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-contentType: application/json + x-accepts: application/json + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + /user/logout: + get: + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: application/json + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-contentType: application/json + x-accepts: application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-contentType: application/json + x-accepts: application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Someting wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + $ref: '#/components/requestBodies/inline_object_2' + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-contentType: application/json + x-accepts: application/json + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + $ref: '#/components/requestBodies/inline_object_3' + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + $ref: '#/components/requestBodies/inline_object_4' + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /fake/inline-additionalProperties: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-contentType: application/json + x-accepts: application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + x-contentType: application/json + x-accepts: application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-contentType: application/json + x-accepts: application/json + /fake/body-with-file-schema: + put: + description: For this test, the body for this request much reference a schema + named `File`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + x-contentType: application/json + x-accepts: application/json + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_5' + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: application/json +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' + inline_object_2: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_2' + inline_object_3: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_3' + inline_object_4: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_4' + inline_object_5: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_5' + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: '{}' + phone: phone + objectWithNoDeclaredProps: '{}' + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: test code generation for any type Here the 'type' attribute + is not specified, which means the value can be anything, including the + null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + anyTypePropNullable: + description: test code generation for any type Here the 'type' attribute + is not specified, which means the value can be anything, including the + null value, string, number, boolean, array or object. The 'nullable' attribute + does not change the allowed values. + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: ^\d{10}$ + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: /^image_\d{1,3}$/i + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: an object with no declared properties and no undeclared properties, + hence it's an empty map. + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: $special[model.name] + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: ^[a-zA-Z\s]*$ + type: string + origin: + pattern: /^[A-Z\s]*$/i + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - $ref: '#/components/schemas/ChildCat_allOf' + inline_response_default: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + inline_object_2: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + inline_object_3: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + inline_object_4: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + inline_object_5: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + Dog_allOf: + properties: + breed: + type: string + Cat_allOf: + properties: + declawed: + type: boolean + ChildCat_allOf: + properties: + name: + type: string + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle new file mode 100644 index 000000000000..6c7675d844bc --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -0,0 +1,125 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'org.openapitools' +version = '1.0.0' + +buildscript { + repositories { + maven { url "https://repo1.maven.org/maven2" } + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + } +} + +repositories { + jcenter() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided 'javax.annotation:jsr250-api:1.0' + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven' + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + install { + repositories.mavenInstaller { + pom.artifactId = 'petstore-openapi3-jersey2-java8' + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + swagger_annotations_version = "1.5.22" + jackson_version = "2.10.3" + jackson_databind_version = "2.10.4" + jackson_databind_nullable_version = "0.2.1" + jersey_version = "2.27" + junit_version = "4.13" + scribejava_apis_version = "6.9.0" + tomitribe_http_signatures_version = "1.3" +} + +dependencies { + compile "io.swagger:swagger-annotations:$swagger_annotations_version" + compile "com.google.code.findbugs:jsr305:3.0.2" + compile "org.glassfish.jersey.core:jersey-client:$jersey_version" + compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" + compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" + compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + compile "com.github.scribejava:scribejava-apis:$scribejava_apis_version" + compile "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" + testCompile "junit:junit:$junit_version" +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt new file mode 100644 index 000000000000..f83f373eda21 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt @@ -0,0 +1,25 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "petstore-openapi3-jersey2-java8", + version := "1.0.0", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.5.22", + "org.glassfish.jersey.core" % "jersey-client" % "2.25.1", + "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1", + "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", + "com.github.scribejava" % "scribejava-apis" % "6.9.0" % "compile", + "org.tomitribe" % "tomitribe-http-signatures" % "1.3" % "compile", + "junit" % "junit" % "4.13" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..07d5223bc5c9 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/AdditionalPropertiesClass.md @@ -0,0 +1,19 @@ + + +# AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **Map<String, String>** | | [optional] +**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**anytype1** | **Object** | | [optional] +**mapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**mapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**mapWithUndeclaredPropertiesAnytype3** | **Map<String, Object>** | | [optional] +**emptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**mapWithUndeclaredPropertiesString** | **Map<String, String>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Animal.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Animal.md new file mode 100644 index 000000000000..c8e18ae55e4f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Animal.md @@ -0,0 +1,13 @@ + + +# Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..6740d5770dae --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md @@ -0,0 +1,74 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +## call123testSpecialTags + +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Apple.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Apple.md new file mode 100644 index 000000000000..5a34a5a33a60 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Apple.md @@ -0,0 +1,13 @@ + + +# Apple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cultivar** | **String** | | [optional] +**origin** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/AppleReq.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/AppleReq.md new file mode 100644 index 000000000000..dd50fef8c0fb --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/AppleReq.md @@ -0,0 +1,13 @@ + + +# AppleReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cultivar** | **String** | | +**mealy** | **Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..a48aa23e78ee --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,12 @@ + + +# ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..fa2909211a07 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md @@ -0,0 +1,12 @@ + + +# ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayTest.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayTest.md new file mode 100644 index 000000000000..9ad1c9814a51 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ArrayTest.md @@ -0,0 +1,14 @@ + + +# ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **List<String>** | | [optional] +**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional] +**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Banana.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Banana.md new file mode 100644 index 000000000000..09f700d3c382 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Banana.md @@ -0,0 +1,12 @@ + + +# Banana + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lengthCm** | [**BigDecimal**](BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/BananaReq.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/BananaReq.md new file mode 100644 index 000000000000..a5054746cf50 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/BananaReq.md @@ -0,0 +1,13 @@ + + +# BananaReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lengthCm** | [**BigDecimal**](BigDecimal.md) | | +**sweet** | **Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/BasquePig.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/BasquePig.md new file mode 100644 index 000000000000..af67d7e9c97c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/BasquePig.md @@ -0,0 +1,12 @@ + + +# BasquePig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Capitalization.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Capitalization.md new file mode 100644 index 000000000000..7b73c40b5545 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Capitalization.md @@ -0,0 +1,17 @@ + + +# Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**scAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Cat.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Cat.md new file mode 100644 index 000000000000..39c2f864df88 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Cat.md @@ -0,0 +1,12 @@ + + +# Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/CatAllOf.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/CatAllOf.md new file mode 100644 index 000000000000..1098fd900c5d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/CatAllOf.md @@ -0,0 +1,12 @@ + + +# CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Category.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Category.md new file mode 100644 index 000000000000..613ea9f7ee24 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Category.md @@ -0,0 +1,13 @@ + + +# Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md new file mode 100644 index 000000000000..e6548f036ffb --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md @@ -0,0 +1,12 @@ + + +# ChildCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCatAllOf.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCatAllOf.md new file mode 100644 index 000000000000..abd7adedbcc5 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCatAllOf.md @@ -0,0 +1,12 @@ + + +# ChildCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ClassModel.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ClassModel.md new file mode 100644 index 000000000000..d5453c20133a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ClassModel.md @@ -0,0 +1,13 @@ + + +# ClassModel + +Model for testing model with \"_class\" property +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Client.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Client.md new file mode 100644 index 000000000000..228df492383f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Client.md @@ -0,0 +1,12 @@ + + +# Client + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ComplexQuadrilateral.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ComplexQuadrilateral.md new file mode 100644 index 000000000000..21602809de4b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ComplexQuadrilateral.md @@ -0,0 +1,13 @@ + + +# ComplexQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/DanishPig.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/DanishPig.md new file mode 100644 index 000000000000..889ee86cd4eb --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/DanishPig.md @@ -0,0 +1,12 @@ + + +# DanishPig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/DefaultApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/DefaultApi.md new file mode 100644 index 000000000000..afb01fb82916 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/DefaultApi.md @@ -0,0 +1,68 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | + + + +## fooGet + +> InlineResponseDefault fooGet() + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + InlineResponseDefault result = apiInstance.fooGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Dog.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Dog.md new file mode 100644 index 000000000000..73cedf2bc919 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Dog.md @@ -0,0 +1,12 @@ + + +# Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/DogAllOf.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/DogAllOf.md new file mode 100644 index 000000000000..cbeb9e9a22df --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/DogAllOf.md @@ -0,0 +1,12 @@ + + +# DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Drawing.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Drawing.md new file mode 100644 index 000000000000..66dd1d879e09 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Drawing.md @@ -0,0 +1,15 @@ + + +# Drawing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mainShape** | [**Shape**](Shape.md) | | [optional] +**shapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**nullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**shapes** | [**List<Shape>**](Shape.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumArrays.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumArrays.md new file mode 100644 index 000000000000..869b7a6c066d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumArrays.md @@ -0,0 +1,31 @@ + + +# EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + + + +## Enum: JustSymbolEnum + +Name | Value +---- | ----- +GREATER_THAN_OR_EQUAL_TO | ">=" +DOLLAR | "$" + + + +## Enum: List<ArrayEnumEnum> + +Name | Value +---- | ----- +FISH | "fish" +CRAB | "crab" + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumClass.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumClass.md new file mode 100644 index 000000000000..b314590a7591 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md new file mode 100644 index 000000000000..1692bd664d04 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EnumTest.md @@ -0,0 +1,57 @@ + + +# EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | +**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + + + +## Enum: EnumStringEnum + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + + +## Enum: EnumStringRequiredEnum + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + + +## Enum: EnumIntegerEnum + +Name | Value +---- | ----- +NUMBER_1 | 1 +NUMBER_MINUS_1 | -1 + + + +## Enum: EnumNumberEnum + +Name | Value +---- | ----- +NUMBER_1_DOT_1 | 1.1 +NUMBER_MINUS_1_DOT_2 | -1.2 + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/EquilateralTriangle.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EquilateralTriangle.md new file mode 100644 index 000000000000..afe879d01a5d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/EquilateralTriangle.md @@ -0,0 +1,13 @@ + + +# EquilateralTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**triangleType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md new file mode 100644 index 000000000000..184fa525ad6b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -0,0 +1,998 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | + + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Boolean**| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **BigDecimal**| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## testBodyWithFileSchema + +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithQueryParams + +> testBodyWithQueryParams(query, user) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + apiInstance.testBodyWithQueryParams(query, user); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test "client" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters +假端點 +偽のエンドポイント +가짜 엔드 포인트 + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = new LocalDate(); // LocalDate | None + OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **BigDecimal**| None | + **_double** | **Double**| None | + **patternWithoutDelimiter** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **File**| None | [optional] + **date** | **LocalDate**| None | [optional] + **dateTime** | **OffsetDateTime**| None | [optional] + **password** | **String**| None | [optional] + **paramCallback** | **String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "-efg"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) + List enumFormStringArray = "$"; // List | Form parameter enum test (string array) + String enumFormString = "-efg"; // String | Form parameter enum test (string) + try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> testGroupParameters().requiredStringGroup(requiredStringGroup).requiredBooleanGroup(requiredBooleanGroup).requiredInt64Group(requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute(); + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + api.testGroupParameters() + .requiredStringGroup(requiredStringGroup) + .requiredBooleanGroup(requiredBooleanGroup) + .requiredInt64Group(requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **Integer**| Required String in group parameters | + **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **Long**| Required Integer in group parameters | + **stringGroup** | **Integer**| String in group parameters | [optional] + **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] + **int64Group** | **Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + + +## testInlineAdditionalProperties + +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testInlineAdditionalProperties(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Map<String, String>**](String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testJsonFormData + +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + apiInstance.testJsonFormData(param, param2); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..db98afa721ec --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md @@ -0,0 +1,81 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..3a95e27d7c09 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FileSchemaTestClass.md @@ -0,0 +1,13 @@ + + +# FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**List<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Foo.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Foo.md new file mode 100644 index 000000000000..02c7ef53f5fa --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Foo.md @@ -0,0 +1,12 @@ + + +# Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FormatTest.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FormatTest.md new file mode 100644 index 000000000000..742bccb77e98 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FormatTest.md @@ -0,0 +1,26 @@ + + +# FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | | [optional] +**int32** | **Integer** | | [optional] +**int64** | **Long** | | [optional] +**number** | [**BigDecimal**](BigDecimal.md) | | +**_float** | **Float** | | [optional] +**_double** | **Double** | | [optional] +**string** | **String** | | [optional] +**_byte** | **byte[]** | | +**binary** | [**File**](File.md) | | [optional] +**date** | [**LocalDate**](LocalDate.md) | | +**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] +**password** | **String** | | +**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Fruit.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Fruit.md new file mode 100644 index 000000000000..996ca25a611c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Fruit.md @@ -0,0 +1,15 @@ + + +# Fruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**cultivar** | **String** | | [optional] +**origin** | **String** | | [optional] +**lengthCm** | [**BigDecimal**](BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FruitReq.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FruitReq.md new file mode 100644 index 000000000000..fee546976b09 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FruitReq.md @@ -0,0 +1,15 @@ + + +# FruitReq + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cultivar** | **String** | | +**mealy** | **Boolean** | | [optional] +**lengthCm** | [**BigDecimal**](BigDecimal.md) | | +**sweet** | **Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/GmFruit.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/GmFruit.md new file mode 100644 index 000000000000..eca752bf3120 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/GmFruit.md @@ -0,0 +1,15 @@ + + +# GmFruit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**cultivar** | **String** | | [optional] +**origin** | **String** | | [optional] +**lengthCm** | [**BigDecimal**](BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/GrandparentAnimal.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/GrandparentAnimal.md new file mode 100644 index 000000000000..d47f146ed7f9 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/GrandparentAnimal.md @@ -0,0 +1,12 @@ + + +# GrandparentAnimal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**petType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..4795b40ef65e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md @@ -0,0 +1,13 @@ + + +# HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [readonly] +**foo** | **String** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/HealthCheckResult.md new file mode 100644 index 000000000000..11bb9026e461 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/HealthCheckResult.md @@ -0,0 +1,13 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject.md new file mode 100644 index 000000000000..999fe3ef00ad --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject.md @@ -0,0 +1,13 @@ + + +# InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject1.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject1.md new file mode 100644 index 000000000000..b3828dfae456 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject1.md @@ -0,0 +1,13 @@ + + +# InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String** | Additional data to pass to server | [optional] +**file** | [**File**](File.md) | file to upload | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject2.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject2.md new file mode 100644 index 000000000000..7e4ed7591c2a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject2.md @@ -0,0 +1,32 @@ + + +# InlineObject2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumFormStringArray** | [**List<EnumFormStringArrayEnum>**](#List<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] +**enumFormString** | [**EnumFormStringEnum**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] + + + +## Enum: List<EnumFormStringArrayEnum> + +Name | Value +---- | ----- +GREATER_THAN | ">" +DOLLAR | "$" + + + +## Enum: EnumFormStringEnum + +Name | Value +---- | ----- +_ABC | "_abc" +_EFG | "-efg" +_XYZ_ | "(xyz)" + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject3.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject3.md new file mode 100644 index 000000000000..c1ebfe2578d6 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject3.md @@ -0,0 +1,25 @@ + + +# InlineObject3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | None | [optional] +**int32** | **Integer** | None | [optional] +**int64** | **Long** | None | [optional] +**number** | [**BigDecimal**](BigDecimal.md) | None | +**_float** | **Float** | None | [optional] +**_double** | **Double** | None | +**string** | **String** | None | [optional] +**patternWithoutDelimiter** | **String** | None | +**_byte** | **byte[]** | None | +**binary** | [**File**](File.md) | None | [optional] +**date** | [**LocalDate**](LocalDate.md) | None | [optional] +**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | None | [optional] +**password** | **String** | None | [optional] +**callback** | **String** | None | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject4.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject4.md new file mode 100644 index 000000000000..5ebef872403a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject4.md @@ -0,0 +1,13 @@ + + +# InlineObject4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **String** | field1 | +**param2** | **String** | field2 | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject5.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject5.md new file mode 100644 index 000000000000..42d2673574b7 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineObject5.md @@ -0,0 +1,13 @@ + + +# InlineObject5 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String** | Additional data to pass to server | [optional] +**requiredFile** | [**File**](File.md) | file to upload | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..63c30c2b7334 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/InlineResponseDefault.md @@ -0,0 +1,12 @@ + + +# InlineResponseDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/IsoscelesTriangle.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/IsoscelesTriangle.md new file mode 100644 index 000000000000..31c0788e0229 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/IsoscelesTriangle.md @@ -0,0 +1,13 @@ + + +# IsoscelesTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**triangleType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Mammal.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Mammal.md new file mode 100644 index 000000000000..24eaa1de4f50 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Mammal.md @@ -0,0 +1,25 @@ + + +# Mammal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasBaleen** | **Boolean** | | [optional] +**hasTeeth** | **Boolean** | | [optional] +**className** | **String** | | +**type** | [**TypeEnum**](#TypeEnum) | | [optional] + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +PLAINS | "plains" +MOUNTAIN | "mountain" +GREVYS | "grevys" + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/MapTest.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/MapTest.md new file mode 100644 index 000000000000..c35c3cf2c0be --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/MapTest.md @@ -0,0 +1,24 @@ + + +# MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] + + + +## Enum: Map<String, InnerEnum> + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..3dc283ae4936 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | [**UUID**](UUID.md) | | [optional] +**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**map** | [**Map<String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Model200Response.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Model200Response.md new file mode 100644 index 000000000000..f9928d70622c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Model200Response.md @@ -0,0 +1,14 @@ + + +# Model200Response + +Model for testing model name starting with number +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | [optional] +**propertyClass** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelApiResponse.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelApiResponse.md new file mode 100644 index 000000000000..14fb7f1ed27b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelApiResponse.md @@ -0,0 +1,14 @@ + + +# ModelApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelReturn.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelReturn.md new file mode 100644 index 000000000000..5005d4b72392 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelReturn.md @@ -0,0 +1,13 @@ + + +# ModelReturn + +Model for testing reserved words +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **Integer** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Name.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Name.md new file mode 100644 index 000000000000..b815a0b4c994 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Name.md @@ -0,0 +1,16 @@ + + +# Name + +Model for testing model name same as property name +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | +**snakeCase** | **Integer** | | [optional] [readonly] +**property** | **String** | | [optional] +**_123number** | **Integer** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/NullableClass.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/NullableClass.md new file mode 100644 index 000000000000..7567ec0c0579 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/NullableClass.md @@ -0,0 +1,23 @@ + + +# NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **Integer** | | [optional] +**numberProp** | [**BigDecimal**](BigDecimal.md) | | [optional] +**booleanProp** | **Boolean** | | [optional] +**stringProp** | **String** | | [optional] +**dateProp** | [**LocalDate**](LocalDate.md) | | [optional] +**datetimeProp** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**arrayNullableProp** | **List<Object>** | | [optional] +**arrayAndItemsNullableProp** | **List<Object>** | | [optional] +**arrayItemsNullable** | **List<Object>** | | [optional] +**objectNullableProp** | **Map<String, Object>** | | [optional] +**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] +**objectItemsNullable** | **Map<String, Object>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/NullableShape.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/NullableShape.md new file mode 100644 index 000000000000..11a9785c3bad --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/NullableShape.md @@ -0,0 +1,14 @@ + + +# NullableShape + +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/NumberOnly.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/NumberOnly.md new file mode 100644 index 000000000000..1c12b6adf3bd --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/NumberOnly.md @@ -0,0 +1,12 @@ + + +# NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Order.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Order.md new file mode 100644 index 000000000000..409fc4cc9616 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Order.md @@ -0,0 +1,27 @@ + + +# Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**petId** | **Long** | | [optional] +**quantity** | **Integer** | | [optional] +**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] +**complete** | **Boolean** | | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterComposite.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterComposite.md new file mode 100644 index 000000000000..e06292218847 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterComposite.md @@ -0,0 +1,14 @@ + + +# OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnum.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnum.md new file mode 100644 index 000000000000..1f9b723eb8e7 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..cbc7f4ba54d2 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..f71dea30ad00 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..99e6389f4278 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ParentPet.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ParentPet.md new file mode 100644 index 000000000000..e1fabb2e4aa7 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ParentPet.md @@ -0,0 +1,11 @@ + + +# ParentPet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Pet.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Pet.md new file mode 100644 index 000000000000..37ac007b7931 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Pet.md @@ -0,0 +1,27 @@ + + +# Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +AVAILABLE | "available" +PENDING | "pending" +SOLD | "sold" + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md new file mode 100644 index 000000000000..481aad16d4c9 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md @@ -0,0 +1,657 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +## addPet + +> addPet(pet) + +Add a new pet to the store + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.addPet(pet); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + apiInstance.deletePet(petId, apiKey); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List tags = Arrays.asList(); // List | Tags to filter by + try { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + + +## updatePet + +> updatePet(pet) + +Update an existing pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.updatePet(pet); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + apiInstance.updatePetWithForm(petId, name, status); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **requiredFile** | **File**| file to upload | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Pig.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Pig.md new file mode 100644 index 000000000000..46c64ad2039c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Pig.md @@ -0,0 +1,12 @@ + + +# Pig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Quadrilateral.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Quadrilateral.md new file mode 100644 index 000000000000..66243e75dd0d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Quadrilateral.md @@ -0,0 +1,13 @@ + + +# Quadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/QuadrilateralInterface.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/QuadrilateralInterface.md new file mode 100644 index 000000000000..24050740c873 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/QuadrilateralInterface.md @@ -0,0 +1,12 @@ + + +# QuadrilateralInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quadrilateralType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..a692499dc661 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ReadOnlyFirst.md @@ -0,0 +1,13 @@ + + +# ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [readonly] +**baz** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ScaleneTriangle.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ScaleneTriangle.md new file mode 100644 index 000000000000..5d30088669b5 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ScaleneTriangle.md @@ -0,0 +1,13 @@ + + +# ScaleneTriangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**triangleType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Shape.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Shape.md new file mode 100644 index 000000000000..06c79169b0b1 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Shape.md @@ -0,0 +1,13 @@ + + +# Shape + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ShapeInterface.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ShapeInterface.md new file mode 100644 index 000000000000..f9d200d032b0 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ShapeInterface.md @@ -0,0 +1,12 @@ + + +# ShapeInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ShapeOrNull.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ShapeOrNull.md new file mode 100644 index 000000000000..a4b9f4f00580 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ShapeOrNull.md @@ -0,0 +1,14 @@ + + +# ShapeOrNull + +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/SimpleQuadrilateral.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/SimpleQuadrilateral.md new file mode 100644 index 000000000000..b944413849ce --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/SimpleQuadrilateral.md @@ -0,0 +1,13 @@ + + +# SimpleQuadrilateral + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/SpecialModelName.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/SpecialModelName.md new file mode 100644 index 000000000000..934b8f0f25d7 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/SpecialModelName.md @@ -0,0 +1,12 @@ + + +# SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**$specialPropertyName** | **Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md new file mode 100644 index 000000000000..5d2d7ad5118b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md @@ -0,0 +1,276 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + apiInstance.deleteOrder(orderId); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## getInventory + +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(order); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Tag.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Tag.md new file mode 100644 index 000000000000..f24eba7d222e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Tag.md @@ -0,0 +1,13 @@ + + +# Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Triangle.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Triangle.md new file mode 100644 index 000000000000..80d75b28e70f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Triangle.md @@ -0,0 +1,13 @@ + + +# Triangle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**triangleType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/TriangleInterface.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/TriangleInterface.md new file mode 100644 index 000000000000..c15bd90f0bac --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/TriangleInterface.md @@ -0,0 +1,12 @@ + + +# TriangleInterface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triangleType** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/User.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/User.md new file mode 100644 index 000000000000..93243ceb71ac --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/User.md @@ -0,0 +1,23 @@ + + +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **Integer** | User Status | [optional] +**objectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**objectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**anyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**anyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md new file mode 100644 index 000000000000..d7e613c24af5 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md @@ -0,0 +1,525 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +## createUser + +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + apiInstance.createUser(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(user) + +Creates list of users with given input array + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithArrayInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## createUsersWithListInput + +> createUsersWithListInput(user) + +Creates list of users with given input array + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithListInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + apiInstance.deleteUser(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## loginUser + +> String loginUser(username, password) + +Logs user into the system + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.logoutUser(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## updateUser + +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User user = new User(); // User | Updated user object + try { + apiInstance.updateUser(username, user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Whale.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Whale.md new file mode 100644 index 000000000000..562b49786da0 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Whale.md @@ -0,0 +1,14 @@ + + +# Whale + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasBaleen** | **Boolean** | | [optional] +**hasTeeth** | **Boolean** | | [optional] +**className** | **String** | | + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/Zebra.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Zebra.md new file mode 100644 index 000000000000..156de233f7f0 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/Zebra.md @@ -0,0 +1,23 @@ + + +# Zebra + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**TypeEnum**](#TypeEnum) | | [optional] +**className** | **String** | | + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +PLAINS | "plains" +MOUNTAIN | "mountain" +GREVYS | "grevys" + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/git_push.sh b/samples/openapi3/client/petstore/java/jersey2-java8/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/gradle.properties b/samples/openapi3/client/petstore/java/jersey2-java8/gradle.properties new file mode 100644 index 000000000000..05644f0754af --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/gradle.properties @@ -0,0 +1,2 @@ +# Uncomment to build for Android +#target = android \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar b/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e35d600ab118c93d7e23084511e366fb638b1225 GIT binary patch literal 99814 zcma&PhnHnlwJv@t=bUrSIp>^n&UGs1oO3`_5J6C)fQV#4P=at(crZqH6Psi=P3S<2 z-s{!tz1}y*@BIPq`}SPDPc`WMy)nKS)?E9nz1B?oRMn}f)&>hpdxOE&)?hG{feZ$7 zjT;PhkWE#cWl43-)hQN+*6S`@{O>pZS8-7(E-3+dp1icFthuhbs-rWxsTvnGfq=$_ zq+|%EhNO5geDqR#Dzpq42~UEk1MxKpb%|#7kP{%FKMu?%N(NlQC(7Fs!W*l;|3X>@j}V`Fq}V{$DrEqQ!lbbTE!ZU-%aNs7SxPYry+Aj=Js?_wL zx?A??)6By{5Wv)qSP-3S71LKV(hZKFB3^jh0wxF=vw>m`O2|oW)y*uk@+f@>g|*=X za!&%=e)D&{N%m}^7es$LSRM~?5)s@VaP9>I&w2583r;g)IToSwo!pRW8B~ebI)V&1 zb00W;(HiBl0{X**h8!ghDbE7r2qG-(rc<4ukY~a@r4Ll|KfQrmlh8uD6cbk zq(J3WB*xDw$&8@@cy5-}(iYeh2$=it=dJ}_46HRqjR84-AFnj|x&WiPx-oFU7cc3m zF$Zd~3{90@S8eb}rz@=Nd@5uzHEP^nH1IM|YQ$)FHS=nMzTD@1z21He+|^sNbge=U zDQ{MpwPM83#=Si~95QS?FemEZ^IL`vBFh{`S#s~)3Kr^|JX!~NWTsjM^hs;hStbbJ z4w>?RpNNf)?PjKgJ1Bv>0lGj`DgX7Qd%$^5fH@XBDmt5mm#E7Ig z!^o;#hyV-SPmY0b=K+?wRUVvwpb0}AJhIb(49#Oy#MuM@#&#soZZ5+gRKoFHcIW3K1y-8}Ay0nEM` zEC>X2=dP=0^S-=|qX!Q><_RWndhcdkPlqSV=tX+l>Ak1H1qJqy<2(Rg;duboqV|3WJsHH9 z0G&be;1+Re<%|O!IG)+sPU^CvQyVnS3->^*m99TO`a16cj0Eu{{>;WsM>B9O{$G9T zMyLYbc|jkAKw~Zf3Gs9^TgNd&)awKWP_OQfqz{ZBmPAW5*f-I=e9~6kqmRaupfbn+ zGj)}Vy!9Yheiv9L$RuP?5Wy2SZ^;Op!@b(bftZc?A~8;ih<=j`U3Y6PpX(3CY+YCf zbH98KxPWP>miY8Bx{V9*In4Mmc1+BCM)_2)aObDo3jw9#it!rK1DddP>=qo9RWtQ7&Wz$dRXI9_6gM zMnM4Voj`<>+vUf7N|SO|3o03meP(;A6;p^C6>uK{7YJ^?iK_(UG6{63G?#G~*8vLZ z!1%0V_5)0Ss53wP<4xa@F?i*cTE_3oCppw7piJw7-2=u1SlI!y7CnNw1aM2HTnG@O za9-KP%wdZRFp5!lDNh-62&P`^#fo?HZKc~-nz5icP$`HTPcx5KZo`1#TeY5!D_nzO z%>-aaF}Qg6niX0?BiVALiOa9&wm@1;fC1Z#6!5h#xn}s@ft$fwGT{;b_{~}6^7hig z^6131FLU^sCf+~Q6%3fk0*l{b!Z?7GuS%en57K#`-vs6k0y_6|e0X}MQ=FLSC?^IQ z7!pC(`&V$G)X>Q3{dKYW^m7qbp6?honjsaqttFDSczC#5KiWdwLvgPnf@tWPD_Y%K<%8(>SlmOc+6lP>l>3xlWY20 zVWwY4K$j;3u#l~}yS;0AI5Wo z-uRE(9s;K)Gt{e@d2io#4F0Fz-Ukjam>Z4JGAI&plK1HY1A8pcD5AWme}y|Pi%VCp z-pplvB@Qi=nnV8iwObrCFQ-;JPB_6Z!Bz-FfTlpj(QAz2A0Pcz8c*T~%BW-o4tf_? zm|6)8Km(|jCp#Eb-7I~IujUTiCWCDufPx^t9vBpH_I0*P=A0k_VnrWW4Kou}>h98G zywch+QQe#oV3SNA)n@DaxUDR|| z6HuRSs1S{Tm;tTFk^3y=iTSY}DM!p=R~{N5#~~l=B9S$XMs~lUKgQb@5imhhp2`sn!xpt?E*;XA!Irw{%Y~=%(m2S{UX>LI72u6rKn#u` zvtdt^ojI$-3$H?N1ugsa*AG<7gm5lkFDk~-+b6)U6I>G3Ji_N^e( z&fm|&cz}WeBh*Z=a~;NZhhEXYzdZ<=fKlnN(}zrR?xlrJ;(6#tbyxF{Pz<`6S~0Ek z@^m~{$|pY_UNr@zh1)Dh2eXI(WA{=K$a06CNp}HnJ`ScLHo-bL`;1J0zxz0Y)v5OA z!0lMScPm?B{}7L)qrP8P2ZjQhxJ=)huXkmtrmIhik_=JYr*fE??j5dQvC9Mkc14sy zq;nHi*MAf2qnGWAeej+7M!X}){Qr5Eg@^ynZrSF>%;eI>?D*)$vgz^Pft8os%RGx9 zTiJBzr7jT9Gdcjq&;v*87HPAo(a}tkPBH47IlHh8mRh@;0Ac6abYKX9vNPR~Fl&lw z2J@B&E}(}_!Vvt&r@z~m*eAA$F<#`QdZpO<{UP`EWxz=E*MhN-m>j|MChrJDQD<(X zMJBWvQwPNg&g{u6WS$k3*fL*v4u5t89lM?^Rp9EAmv0ws4)x^2#j@daEK!{WHW;RRruVfc@dbe!3KP`$yAUS3i5RgN=;1OncE=OKw+T6L4R-> z*oj##?O!nhyv_*mk5_&%FxP3u0Q2fw+}7pKvl|3&txIry2Z` z>zjf)49mdTVDJbw7{dPN)}VhG&}X+Z*rOW!)UH|w%ZxKcKEEY{Dx>dT02Xxi77qv= zJWVh23&?FbcNbG-hLPSKALxT91$oafGJ;ZDSC#O&tf@xN)Qz+xBeZg#dhm1qYeTLB zXZ(O|MqFSEF~?m2Ouy+8(bb+^SYRwk!Hhv|XqT96{5N5nicf!V9N$IwxQ=~9^0 zz85W^n~rS?u;I&_F~h||V!=u}sab(p4d;LZyn!2thpRKNKLUnguoAXfraN_B?Zc;D zh_XPXSDD_M2A*$#v%GV+({WGJ;_))n5FS<)CbZ*hFu*`Le9(H#v?TGiNgy53(0Cr+ ztVFlQL)$hT4x{}!uw^z3KqWaeZ9e{0hM1lj1SLJ?lB?P?yRPBNBJjHYxP~g6` z2EmpMy!(O?{36wfw_XPS`wb6)=Ys${h6r#86uBMk&AkqXy177DmKm3aWkTnl-!E$H zrN`WPi^`L6y4)ZiNZ?-|ze|))Z|xk1Ry5a=3t^bHXwLU&iLx@K z4BM7ECeO?>8I^=!3eNSPy7A3lGBFl{UFk8PdS>Eqn-3xS#G`_b9iRxb!i1u$x5mKK z#6DDjt`>a!g9a##9vuz+x(!PImEVkVpUN=|_DPIlkQoPd@yGLYRl!^f6FIHMey(r5 zX%}i8NQX+^jvyPD>}uwjPHvOT%CTZ*%{1uU-+)b&sq%oH2m+KJP3t*T$prY{9=~f# z29xJ+vEo?;eC)9o?Z5StatP*F1qf*CO6wABrX`(e3dDluFW)^MBSY{4^=`wDM+8zm z2Gwr#OP~yJh>HP(n$WW>kB;D_oDR%I8e+SkFYU69{l6&6#?cwBX7Ia{M*IoIc zbH!2y;~qAk(!!daX#zZ7a*h{OgBiL}8@beZ%WhnmmlkbA(#(e&=C8U5^8B{O2ck&+|(@{{*+~1DpMuRq?xkLSSozK+h?x)o z+VKE$QLo&M3Bm}-Ob2rW*?~qG-zJcNuL8={rMA$cgF?XLWnzVH4ZHaBMTp#ex++O| z0IDjm&V1;tW?>k z2R2viBqMO1d&UdQzO)CNZV~uGH0}omywm@2LCib%q`A zaw*d7P|p4wjGp2RJ^%V^wNTa25|as_BPLu$7tZYib`$IhD~@1SUmV{J7HgXbaP3>) zGqJR<=PS$C6Wj+h1Zs-ni+e(ucGi6P#utx+CzX^JwX-<@U)}rzQNV*hnXCiA zO2p}#As4QGmmA>>ld3EdECcj46kxm$@;GT%`+{jzIaQzKP6d0W0u#gH+7^!(JJAik z8p@W$qU33Sc@bmk2pDk^V6A;|%lkL3&;b{pF}X9+q^hdz=rzh~!1F+XpWYzjT@m|q zGlL!0K9e>eHU@OV8;tu2tM*dq?TJzH-=BLP;*&>UV4p=2b@KKvs%A=Vok;?5Zqh|sGbQ1nES+6isoRY z4x3*YwlWeb#$1S9^HMLq$*`^iqZbdjDo`W>oH6E>0p(^o18{LDwh*l%Fa*j#iJDLa z!Irsr{)apiP?I@MFENZWrym2SJN!U6c(YAc%<$?6L-R%=-3>$Y8G-GC$vCqZN{Y1FSYb|30@R_~Is!6_H`&r&Q5&YNhtrrr1rd`(kK9?WqPv{#8|b=sFfIZ zpaAsVZ$gnzyVPq&H(?P(LGb8d z!(g*w6CM@;8NjDO;F4I9=)Z<38GzFqETcA+7<9e^C=X-<>gg$Rg5Z7u*1^8084#`@ z-XGvFlV{uXr+574ySureZJI&A^df^`zaS&JF0Oabevm;|ZpxglVSuJbOc6O#6+d=8$7P-2>+X9k11_E|O+R#I4D>O}eH#MkUEEnW9 zREQ#+{@q|=+j|-v516LFh38coKz9t}Y;zUZ1{rUN)Fi;zxcHaNuwsnk8-K-AGGenU6?S=1yJ9&TsDw|{g?#>&lb7rApV$!CeeOeUH6+RJd1o74!Sc$L7HW9Z^A|aP1^e zEvRz|EZP9}(c>}TI-(dlW*L`cq$oE*Y)u0LV03ltzJLCD?uC1y0%xBU$qb4IwJ~c# zCd^AJFFiaOa43`D3w>m94r^QB6ToH&@UCGW-UeQht$b=7AX9-Nz*z>s z<|vp$aWn7oHT?Om*R;*@3xt`AEc^#)8nYdQ$wJWeKM!L9(H(&Pk;JtB`6puk z_=9rH5P%K6)RVzY0L^(ZX#g5ZFWpOFTg6(eV}<|`8ROssAeM%JZxgndWI&z>;g%-{ z(3t>do=IMd5_>(D0h+w+-u@0`q7029z*SS4zxwd7ErzXKe715rgOL=}K)8#lZpYjk z0!8zpjd1O^ig=Jorm;6jRpZ$Qq2~^&{A&o^`1tm~a-U`xf%(tB1#Wh|^TYBExDRXX z6N`=pL&iULeAUkQ!shzy)@1eU!erU_I6kD|yHxJ$?{D+}6ckY#uO` zxfUk#wQZdYF0U}pdVKuoncFBx}0ln=zp0K9c%2i(Px=VazY za;PH}T7aY0xelTF`O*L+FpyD=MKW3!apet>!cFBIVoG93+NNtCrt%%U_9;EwwCtQgACq$S4*STh&V0PHa@>+d)qU z9ms{HTq23pw+LDT&CNFNK>!SX5r{5gWZ9Y+C0~$F;@rEpLjni9FXsixyL{HDyFoL8 zdSz--M0r_vya!ZPInzz>!409z3-0govtn{->ALzNR4Y(iXHiT3(bhY^UR0~>8$Y>= zyO{tn)&KP#UYf*>urtyOFyufOhzh@k|WryDO)(px%0n_TRbFNV@p>$Ovn9L%Q+1$;vSFm34_ z76hMK44;lwW?YIRn0pUfN`Z11)WZyO76IU~CQ^7ugh+fOpvx z3%J@Dy(UoISWU4ls6GUZDRL6-rgdNrtJCL-pp~gGL-p1te*aSk)+eL0+sF-VGOU0z z)2M4u2H@IvjzU+UaSM!j^M@}7Ze>9^iG$@lp5V(@*FJknWj%(bhSas7V)g#d_CG01`hh{QB~$P^8%9;l|YouZS0V){H<^s*ewJ^Gxf)|^!; z#!gjrsz-@&PXztV-10dDQ};E7gr0i|Lkn%fwuJs;kK0%s2>gdq5DysfljFAc& zG;fv;a1>-r_{)!bd`6ZWf=*l$8MZ#Ip>K0rH$QI!baa~ea=PkvQ3FRtA4d9ZMZIzYVE5-Unt`Bhs)MNpseMexe;yaJiO`9MT(_F6tb`{t1F2*y>kq;Jpd*h(70yQB^Vaj= ztIQYyuX1uc{~!b#Ht_j(+rWKz4g;tJWVe?U$D0AG&Z=XrSGF>=%pp56pc<5S?t9?e zr(lz};@Op7xLd${w&|VkZSAqVYn#L*+~j8mF+`S(L5W)eW51#EBIB3-ZnM>To=cu9Llhps@j|tRhe-or@eR8dKd2zCFd3kOOyte#O0>|P_K;e)&wR9F?=r=}v_eguZ$3%Ak< zwTEC8AOTO-5Xwe1I;9(-g?5>Kdo zn+P(iNVU@uxoWw~*PRc-1W*)+i|~3ux~}o^0nnEZTszW!FTEpZXM($eV&=S)dWNAa zn2xaQ?M%n5rLyW1targjKKpJwdjjAkBK^z*P*}G|*M6@yb+u(yB};v`9rG6maUTL_ z@#U%3!K?we89oLC+Yt1-!QYfK7_uWV;k0kMU;M?6OFGXj7*RXXG7TpBHAtT|T=-p9 zx%PRTkTl&W3KOPe)EE4!)=H;%bASh2QhCN^V!t{=r?BvcxLXb~uBy8;Q75v&fYaXt z3z(~F3=HT>+vtcc#xRMEdwo2~4Fceo1OT1FW!jvZ#Bk^ktF~tlLj;8C!)A`{7>wA0 z{q4awEI+tmRxSx#6bas%!XUQExTlF#2JjU?fvSoG>o~hMrr~s9rOYsaMri2)MK!ud zA2``SW4=(F`ko3E69ZtL0XZvXQFPT-Q&gTb2SN#LJlh+_(JYE_@x5V)zQ(<;> zE1{+4;VT#bwKhD)n99D~qUNYKAHR4DOdbV6?F^4sC>WogCsCnVIC~Xv{vOr#PF|D4 zHR)8pV3rM#U|@x7jS6xsL#*X*z9h;*-sR_@<;BOda?C+ppljbJw|UGT{VOCCR#eQi(6d$VDt8y^yxS+Xh2eQ63ECGofyF7XkN{@Q zKf~v@W5(`lv);2R31B}wIah-LPrkJY=5AZbWIBn!ng4j&_4pM7z9xMzPEs;c;Yxo&JckxeYeL52({Rn8vOi|x#vZ~c-FA5)ED z(0T4QnH8=QgO3*NYm0XC2D&HlZy*Ugm6C;|hvKRSo{`xB zOlJnq&t-Yo6+u_glnLG`eJ;AiqjsrR^)*;nCfTgxbr4|afBO};iZmJciU>RRqw^1o zD!iQ;N1x3PU%XxWTOVR?_L*17mgymu@Fi!*+DYhpRorOe+A#MG9DT}1ggT&@z+F7o z>hu8=_Rc(&tS9Zzmw2AIL2mKX{rX%zOMOV?Nh|B?;6{LMFd3E{G9oD)3{;$25O@cmdp_>KXXyF3R`!uF6fdjlb!1Pg09^oSrh!p|Ory7r)1L7eC zt@J|lI+!1Q+Pwb7y$~#A=42n}o8VS?`W8@!xy&;=yqRvtfdx*idlzoqwuHy?Z~_Cg zUwf|jW#s zx>LH+7@gA(fjKahO1r=Sbq&KhPS*?AGI~IvEDi1FPqR>%AYN@?cJvO=l9O8|+736; z#0%(sAjy5WbB+$}mvP5#Q>R_i2ty1sg0?_ce+Fg;O7#Q-R3_O6F+b?c816v8P4R`m zHE%+70}YFHn0wRF?Atcr(ZQX1@+bh$0C<_vI6Ibq?%B+oVzCLQV|4V5WoNWodZpEP ztVi+IfJ-?8v2V&|Ra4B~LAj(rMPvsU_~bY3;}a>d+gx)(CKn)fFa1OYPlut#i*5-S~IyY5LFFU0Akz#X7);&_9K-@DvP;U zRfeh&`Z1vxcjaGb+aSSOJ3YD+c;&~u0%#Ngo(zggnE2ueNS=1euVU2*$pdi7&u)(K z(!Q$=9pK%1=H7amQQvG5TQ)={s7i(g9wrVn#@GReBEY9Xi~(;7@B~9lwW@>v(Efx3 zRCl&+0j~tO3uDx}5AU{9lkLgnZ5_ZCwGUoH=@=^D%G^HBtdfY24Iqe}LC4^wA9TzX zHQVS0zTk_SWT;Yz4c1XC++m5R32Pb5@A@X~x0cnVG8ISA24Kk4Msg6?Yqg4J0QD| zh0pJRR4s(HOVxI(e8gwEgWYA9$7RVKY=8M01W?5MQ>mN7`wAFPuD|Nrk(`$ZCAT{l zoQcj<9JCGuXJHP2iUT8kavLDJ1 zR}|(qZg+=6QMWJW#()i9dLIbg2;@|7q+3;q@d(Mr`Marn1C`s=VcF~s zoe>7O%t~ZXo_Vy4g;(dX$;N@w^RInCj_<5f{cGfc;`i?q1w5#|>CGG1TPoBI4;Yw6 zAA1(NfT@|rB~x@0lrMe_Hg?jI>>c&l?P6GiFfRwAmjR}+_6L4cE-qKWpzRP+1rZv3 zUf{CSt)hid;^oISAU=7Oai0P)U|A-Q1i6gNO)&Zb(+g<}{G727qz<@SKs(S4x-xCa z4KQW2kCi}%EqHA&pr_sK}-E70ijub#cVK#Z(!plcc|lKC+%25_!BoOH0y{q572_N2`?<$)T$1SpPi z0k@I?IIp~NE7%fBgBMFtz1)M@u%GeUQMk&4pn6ArIzt=TvAUJBp6YV}q#^goWyMQ3}Hvb<1!bea0SV z^gLohFM#UYKD-@bgoRVpHpO=UMIib^aOP1+57s*{odxD%H@?^o=?|&}#h<>loUWO% zJ$(lRE$kj03|Fccz*~aM!L{F0bMIeCf}V8Y*o&pgM0?NzN7TvY?^DG8|Gej6D zLxz0)UMt&9jTrVIdR1T-%Ebm=IuEuC>IT&mfrWrNst%W@*bsokIOeC0ZC%rqCei-= zk(;?=fDevQi^L^}%dde2fB;XmA{$>6YtZe~_hcrW@!e%PsNF&f2Qg<7cyNKLTW3Ez zj2o+Sn1vra1h(QsRlq2^gT_ETAnk9eXfMD3a2@*SMF{4c_KS;RRZAx|Vn|mgYnzhS zxxiJQr!#hZz>-u4VP+LwevS79%6E=!Lu{dh9n@BP6hjFJ8J&%ZJm`eVKFg!om8fTn zdoxP~;G=|9);rqE`}=-;R}O^f3ACr$g4$<*)qD4wCbMy=_GL4qU_=Cy7vMb5_`xmU zTObe6WTQ7YP_b9YoN0_vrJgZ~2`4xL}oCW>c6Tb!r;%c%SAuc^GL-49U{PF<^?VWHduV>$m3ZZu4 zW$iCRLF)$TsGx^{jWKRq$F+oEai|R0g=&-w;;bO)f=E#PY$iBwA((-v0M)sxq7ieh zh`;~nW#?I_qde=zWDEFUOfVeo}w=VhQ5NyJ?@x00@gtr+zu6QmKnf!3-Z-v%pa~bZJ4ad zT)f0UR`$Ppi(CX=w5F@NGRX4_nEY36^Htz1>B&(jyus23$6I5v>L*| zV*`C47e$dKM#WT+|oz=cd){S#alexDaZO-IcKvov>BS|Hb$&+-&smJ9S z?rIa%RMRrkQ4XbtiF^`K39~70-FDJKUjYp~?%>BS=~G*y`K`ade`sbqGk#Dv&YKQ1 zG#CeS_8gyf{}2;mz4xsL+$Xm&Z1)BO zeAg0}>mV;a&`w_f4A$SCekBlMkTtZV@`iWe`Dx>V>Dn)wH_$gg+FYh6;Qe(yU36v- zyIdNG5|{(^vG5k=9N2_1$(Y6i`CtGyJ}xS?xEj$f^K48CwG$?bATtY+8=L#|wcQUN za0t_9oXgueWev8wO0TLtq$O+rePc2TCicS~cQEb&;JT|#U@R{IcU$o31Jj#qw7%Oc zKnIZd%CzZu9|QxCDq{4_r`eI;h^LjcRP)Tc+1D%a}J&iG>HMuJYTy;ox`F+p_ z-%&OuMbzhaf&&e4yLnatYG-2d`>*dmYOx7DF{|0GyVxjJ@G4LQC;`;Kjvv)|{=Q~9 zuh>%irO7x;hJZO2C5(6>_KGT|?RH&U7n zq$|kbn!?=x232@d%0(_>PJ-wL`PY^51%_?yvkZJTwy?iM6oC!6jTF%{eIP+_Wgl}5 zU|d3Kz;Zg$!TIJ;;OGr`{#CHD&Zi2Etk!KQZV03 zM<1*6m}<&+=|0$Z%oFMDvIz_^wJcs9Ne=mn<*>8;u`5Alk|bJ$lG< zFuXwEJ3mW?U^dq95Ud+Ue0MIO(Rs!h;L(9UzVOON4?*UGn9g+DSYS>gqX~p7FR+_!r)@GRS7nAt zbb-}ks%Z>(m&42e)uHV$VlC*<9%eCiSD&)Gat9kw2xp7xz>fUE#_Y6TOywOuzsVUq z$Osm?1!f5nER90eT)v|SB9IQ_8ZjR}Hq5P?ffx?p_>VXI24cY27y{8K#!;StMbV;t zqyfrS$-BRV81lE$wgDAbG^^fZ4)Sc=&3Rs;V{M)x3ic6$K^4RKN8Q;Q%Rpf-~uu19i6AU9DBw)^6n~$6F<0mK$~5SNRx~iIG;zkhX1Q5!oen`JK=O z$q+%|OLXH}u5PWL64h;@C6z4)U_^&NbR#_@h+6OzOGJvHLYaD%;fmI{(%*|9H3WPecyT*VlyEj2%@qIOhsIIvVw)~tCERR zW7@xK;MJoh7h?p3?4JH^G}9}3i1`sR$+DgWz4c?TNzgv%(oeyF;$<+->fo{LgZW_90SmuIHzYV$Aaq9UYrq?J-0B8vWvjef`Z(OV^DVAG3WKtCvbwp06!elE5k<|I~~j>$1L)<)1f52U8fjJbE@LpSY}gC#J4 zMWf^Ik33(Y55}QIccoPe;1g$d!sTI%6V5^@vamfQZT^chQ7bsD?BeU((voSatUovY;ANlW`y6{eZ~y1^bGH z{;=tAZY_;_6=Y0j8F)GuCeHVE8q(gr(^gZrPau+TjTs zbbB2$4G02xUi+!ZcG`AXBfS#RySy3O^p%ZpnwGIGN@#@r&9 z$Uv3r#h-uk!*-Zp1p@dVho$IWq5tIDuhPQwuGMF!eTN9ID^c%6WEF7pFrL=3-22q+ z>`~>m?v7@5t`=Rpkt}#1Q3SJCN7d@AvGvl8n__V2YGZQ7g8Dyu=E5^#9bgZj|GHH* zL(Rzmi*zwN9zJ?kt+o#f-#`KDAHBK@VdKKwXcQaU#tJC&^y7ZXO;lKvg1U_MA&aAU z4B8mvEjN8eltN}8P|v#x^0-OM64i`!bBw9DCQ8`8l zYJbj<@dtP#p0)X$)LQ^iB! zyhk{wJxu01f>T7{8I)SjYQ~?ofA0>NvS;GX7OR|#pY3i~mx+Ohz&So@y6LJo5MS6I z0w&03nE}jMQ(whkvzWmEyoxJ=b3`>gZ7|N!9uF*{Lo3er$~D!qkh~GFdHGp}7GMH+ zbLL3KI?sj{tGz{sQm5jW#2o_+6x|9$$5e_^th!#4ucR*+h?PUgUyk^+;}Qgi~{ z80#_*9z3o6qc0kF)E0Td?oXdJc0iikNiWhx49-?wNArdIp|G^LW%kMX`Njy(MLs!b zDO8yUbuS4FI6UCVasubsUg$TV%hd41;199KD4c{AFgj63?|fz;2D}=`bL-aX5^6GU z_Qh+y;nfVAfMKx$WpLdYv2}+uL#Y@5n-q)Ac|xFPuI+<6AwRi=PpeTMv2KsX`ltJF z*Ssuh?+`q?#+w1zi{54s%BKAXy&!=Lw}7$S=-$!xLe)1h0J0(?MJW@(^9XVw7C`EB z(434a?c@S*`j}Cqzk!N?iYB{?4DR$VH$JUw5UO8@p?DpVKHv+1Y83?AMfw8BXJ6yW zQ>N<2&LMxxzD{r$Z!+&9%2e-MYUz?oCUqQ^kcw*Y;y%e&S(TzCv( zZV`<6&ju2uitn8lF#xW9cObP7()RRge&#Kz?K40fGA}$k+8K&Fh;9O=t6bg3xh{i} zT0X^a)Q`B84*E0K{`BOt+Rw0{o`m*i0x!I5JLSg^Ej4Fm+kf&>b}~=9s46(CV;rNm zo&>XOq;u*(K!21-mAy$UWp9UR`{Nd|dy3$xSt7Q~T^7%BQ=&C<0jLq7{rT`HI}Fs) zRDsFxQSe|;PB~Lr;H3S6t&0rCiwCcL>>7r?6tF6G2RE4(9_7V77CSI~wJbGJ9Q0@NwbQ<=5Y7l9-Rv*@gc*A7c`(a# zeF6%PX*_9w&I=fL2w>MsO zs)K9?1=$ZwGE<6ph}h{=;OrG4WI zDidyzh0d(xzOCNA4gCG@v4c-!jf1Cwbolc~083m4?^7?Mb(IVHoJwppt-k2XEs}Yw z4ZiZ~Ba89cXGPRS`fEk$?$fSfSfb(==>Y-L#|BgZ+6M6iI`|Yg2pX2L(?QW3w3IS1 zN9~6$P;z9hHLQaRr~p8Viq+oir(I=R`G}#l9i#JsgM_Q>r|hssPywh}`{zjZl~7f} zl(a$TB{iV^U9e0LaKOVeGG=>VvmoY`j`FbFsFLC+j9qmbTbLuLm(gwII#r-DHhpeM zD^hPLOcJ0h!+W7Jm}R%9YDMgRycs}|#+whwxRGlM3e@f~il^^bT-u)ta=rGIMmTSD zkY(3-1POQ^sk?@r|9-@LA|GFlDl3Yh+k-;XnEMr!{M*A%L-TFaEl})0+)d`+PN;U@9OyUW~gplWgCZS1 zetOx^a=6Z}>JQ3V1`7lYm+ycJxa6rfy1{urz!t<*j{|9c^Z#03IA;GiViC`SfO^m# zU;p8&+CRF~{tFC-D!EwHokwc_hr1V^#CU+0pF~KMx}YVY&cjn?+##$JdRrmFLEMab z7DEG^vakP1W(l`?5*Zk*>xS6+LR~**g#%yThAA-WY%00rY8IG}sOF!%0EMd*i2*zW zq^79?mwr{tV@1?$f_o_=ROMo50>7MfI`JetFenDKn5vq=IX<}dv+o$@dt4236lia5 zYT%m?F2jb!d(j2#@4>;JiS!L5M_g=m|5C?Y}$89hw7r-3>7ec`xm0t3=tdc!bA>?!Ykw~sdn0U`mr$u85pZghD`~0X_gopXr{r$$LxfiC|Hn#%g@sTDd zf*@VjJ^uJAm*s&{wg1!&1=!vw+dURl`>k=PYfO6`f%UONZnJ4JR)t`Wkpsw-T6_l> z%Z)G|VIaT`G!_K54JruEr;7uE!KOigy6s_I;uIHT7pdiFB6Mw|o zn{O$2S8q@ims*^x@yunq_JWF-66{kMbiw*ZkAu&Jd006$2Pe=9`X=_6hCq-A?rl1L zcQ_idxX!xk(%JF$_w`b%$UqgF8KD9k1LFlXB&I7^(EKV-*!G zg9*mozXOWH8q-FQ?BB(5QL!^J>I|0>>2xu>k+pw^JH*DvKL!V`t4ALjI%qI9Z);m- z!Gkiv9Q*aL@|!+pirJ`*@rJy~*KmX}AFV;4zyItO@POIUQa_a+7y?eQ>AaEZEZf^9 zA+7nb!!q~&iz2}nMQh@<0A1=jxTCTqNm)}nWft5UboystvCZ@EJkE}50Cm&P7k?f! z4xyqlpd8@FvIHjCY*hzQ<>Iv+YDwP=;F7%7&tz&>3Hg! zZakY!%Mds~p?ylxM*BhwBPK8-xb6wo0ixT2mAjerC!w0!O9tnRezuAMkwNRsYILo+s16)hZ?|yC*C^CoK8RpTn|f2WGthb`m@@U=C{9 z01F10(S?_Om-@FSZ|2hdQ(%I$nCgH=s1=^vA(c!!&Q5~ZDFMcfTLCN^cm|KopFFm|bS2n^$v7?I6L2KY+~3Qjc`#`ONhsd$8TVKlWP)Y9fTsLU^fqG3WD1 zW!P8Wd)_d%kghr$>^q?K@X9`WgHii#pwBo%B51VWjzl`%_K@vyrXE7OV=Fg%p|M%K-|^z*@6NM&TrOLu8cS1IZm0gLn`d-VIYf-`SG@;2Ig#n52; zaOep}FgJEBV7;F=Ngkm`%ceIzep1ZQKBL+n7n70jY&%G&O!Gy)0^l$R#MTrV8*J`K zpQMAd56eI@?RXKOcFb1}8X}CAl(eZP3~d$!_<_6`6}vyb%HZ)8Y|%9XbZmcMGC06w zx-Kz4e@-UO{mRfBvejRqvaPg%3pRp2{uNk5DHzMjnook0SWd!-Ss)niUV#!@#dZWR zaRw(u2Oj~2%82z2v@`z8pz;RKJtL%-J(ztE*s8Awugw6}fa!quPUK+7uQ zL?oyh#I&U&4%yzyoVu#=_H44IpqFza!JqwfgAV|x8$0<}W>f(7 zdj?%c4Kz#D7od)^IQKxQAOSZpFX|Y?mWO>(DMJa^RkDl*m{CU1Do9YyW$2~8qVOi& zn#G-(Iw=ONiA)k7u1ospak@MrHAMSI6D8bpSuDK-tc`+AaBE+_;3+2Ig(B#2pmgn! z+u;?=6RHe1FwCQ}E~*w()`(rW3q);k$A|YPt$p|%=&p2gA~)5z5d+Q!1-OIufNie}2Pe>gp3=7^y^uMt`|5H3h6ZUT_j|JBQUONlLHYjv3Zp zpjsa)*sXxta(W|629fz9oguVbY=L6AZMr*KRE4{?D75VnI$xj;T6!FX@j`xy zIfMm+%$p1HoZ6r;ZGo`(uGn)w5S=wQIHhuvOZI>D#>4Gf-7FoT4%8bK-ytLLdiK72 zUa0OWGkI%4P*^j-_5YT)zE!N?o5KyFD{;6jLq;!kEtAs^x=zaKv(aTnR->AT!@?Cg*;SPu_+C`dg;$@_8ImnV9$P1 z6z~~!&!+O>$SNL@>81S@7VWnN7`?D!Zn55aC5}Y~)E;fAOCA{63hC~Voc<6e}as>AY!={3)VRB^&Z;;8`H@9Fg2sNVQ@bv4}%cKFf%437lPZT z4~-zeKwaS7W9AjJJ(ahtTZ&IV1YP^P(U1(x$n=*tr&)6iSCF8|0Wul14pO}u8q-RU zTPf0T{Rd8AV4J?8Y5JUXlU0^!c71-2UK-JS=4s4Y4D-)pI4=l@+RVt6Rc~GFF9&8 zySRjTOCOKVg8{2=|B(G56%_0j0nSZrZFFt(G(0PlpY8(M3Pdt;fUDLl!M%ymy zGCz3a^8MW69_Rq%dChBsjYk*)>pg68fa|sY)y-04;i>l9%vM3~Z0*xe79j1j>vK>5 z+e0v;ZNr3*TlBt{n;7eZ{phbdlB!C2izNZH zUYF1-+7EMNri(7wZ=*j4K&F(T%k09^!c^V!U4+SNbzuWcj`!~d0|M*SeV{WO+V``9 zpe(aF*4AmCu<~T0+VlAZbc5)oy3f@Tar8UjlmeD0I@9Ev_>b>D#nZ&EZgT-Q>d{MJ z!&mOjx%A-i*ZwQU@{;yh3^Rja#KK_6{m1>Ob#!Bi|9NPyP0?Jg1n;u);e|m=7WSgOv1XUv18R1qkK?OwgyFY9kWWKZV1)h%O z>{(0&pdQp%p4P2pf+|9p`5I^1A1=KA7=%yMPA@NQ80RyGRaOoHm{rF;hswZLsI5V( zjRF&FKxBf>zRDMT4cZ&M85o-BT}K8mS>Y8$0ef-Us3XV_ZVS(v*mvrLmR)q$A9AKVQl za6KCM{6|o)+-+ zKaeX37+M!8e00x~cTEF%f@*n|Muu_>I5Y(0S$Y*WMlkF_i&t8-roM*IeQbNI_I^IlB#Xx%N5}4 zExp>G7=?1`rkR~7$a2tV22V~ul!4Mg4r&_>_F4>?S{I*cI{V`|UdRg3kz+}Jr-0(- zk2C)8?1QYK5+m4poJ;&B1WwM0oRw#Z(bGC?c&$3xu{I2u>~qr8=E|t z_MC%M0UOMKesoYC#lq&9wsIAk8DvnKITi`Jgck%&I zxAKm@>7hnwE^npV>IbXBVXAzEe)@#z4b+JUgBa-i+aFk!l$V&dz}HVkixMXSJhPsM zE5Ar@yXuILCU|Q^;D9vfEPz?WVlyU9@Ks|*BX2G|jRxKQx>Ikv?+$~cTU{IKP&Fgi z(_yc_vq--BBT1 zxP>54a>^*Uz*NMcO1%dP>m6|Jp?STxxi70*8b*4bx3{h`+$!`I>tVNAE7U>|^MkRj zgQ>A*pf|gc`$cD9x6@#QOkSGSXEWf-dmuM*x$MQbdT=&DtPzQ4?orc}hOxdlaGQ+Y z0j?kw6qj6_8er-GEtBTyOfR4hSDV3-7E(_3Q`IyWkAjHBL^W&Vg*mzK`zfFQHSpa;ckZ*8h{rpMb`DKs|`bvhJs{)Oo3SUL|Ph4hFcAZJxImVJrfB9jsD+J^b;vPe2w~ zgYn=6uJItK^bnYiGSRxPJ?>9e0!)mJmAQpYBnwhb9$29aYTsxURX7839h3ypzB+#6L1>pB<^pLU&dpVFZE0!+ zPz61s35;4D8@(lQ(%`*X$FzM-{iWZQN}GWZ|w%+kzGuI&pIU=7e&o*3N%S6vH+ zraf*eD?DYBQveBSV^A%(jahXVBbHfQFTl7E@c4LoAc;#>?v^2)dqDGH5po_dKKnE2 zW))Zym8(7Ziph!3?K!*U?yYO72QBT{WkU%WZJb$KC?qhR>8`A1gO=yn!{A)Xz>vyR z?RU)=w20Y8zu?q!bbl^yg`r$C^OZ4M3<9n{o-7KuLvf6rX+akf;zkEh?n}k6q zDg~~-FP$OQydeO#=^_`^42#_9jpw8jJQu{;!q-@qAjf(W#{-ali~%~RF3ugi)?@HM z*ji)FjmNHXN#iDo79&PudFLNa=lsz}|G*s^G)2)#yvMeI8uZWQEuf`?3-JVPuJwYe z*E{r&FG%~nO-N^uU}4KYV|#jLhj+Yy40~|C#ykJ)igpK0*1o&MEB1#38e0GPsb`jx z&}at%>D?m1`#rvX8Y1-kZ^IzGK`rCiS;LS()yyCxYA?fB+uF_PE8xoAYOE)8c*sQh zqB7kXl)yxX?JPtGcc6m>8At`O0QmPL=8OK1wa^d1_HB^}a5bJDW3 zr@%_rpiG0V-pzVu<(Zhs1A%}lk-~FRXk-BcjzI;ii-=as9h%V|Ek_59s1PbVf0z@| z1p8t99}nCc-4b%;jVNZ-m5*d>8^U`p@6NrAw)Uy1~Ob0!Z0Tw_IoGvT@XHBiApFwQ}P^4@9@&6NRLJYmne(y4s~ zO;q99`$WUgzkE5Nqj`Q6o63*Tv0BPRucrBR1F$wFueSGx7cl( z1c*MykRE7ed<5|dqaZ=Uu+K^x)GcSQ#9-+(gXp#XKc5`t_6A)?lgA)yK`M=`qW9d6 zUcg7hEs2$EN_#a~8ps&CECB$EqyrbVADd_}4suo4?tcsT0iGW4GXkB#I z%Xeo$s{m~tVx8b1(`XgMvZ7->DWSNLD>nkofp!l0l=7&6IGzL0le`qyQ%#q0K44x% zwuryK_<53OI#&_ms7hWA22=^~mSg(pUx1m?&FCpj)t-Lr_w}cPc4)fgbMnAcmWSJ5 z&ewD0yyDbKJh-}cklz=tt9Vn(vu|+pPp@>tA&d!TtST+6J?Wr=^Y6N`JPPRCaF89t z%Y&uG52SJk8j!xhbYxWYW^;=+Ab~#w`)R2-5cdG2fm+MKSnQ*BpS@^;#wG}`tF|cd z1{0o?X1BJ^+~TM+&_oQrpW|Cgr` zsb9@1oShjNA6>?$nfL$61!qs!I_7g*d&z@F1z#{4Zy7p|^8ywY0p?}RRnCPb4mTg6 z!2#}EN61b@b&$G0G3o?~t9*H)!a0Por{YgPLKNo90T4?dV_Zi+d;0Q3?}aszMv@(P+LRg>O<1f`S?m!O_a3urj+*R?puiCy)zy$-RShc_J%`InoDA$F{CPx$rqyM>klr-hJV1sF$AOq^3hEU!ZfXf&(1l#DIFy0L^r$ z|MDG-AqJLznJRm`KQ-FS!TvrdbfDrB5 zXV%cP16FdPVvJqUq9dl=s5ygx8TRmsmQLB=yetJvncFg$xzky80FIz}XDy$rcAp=S z?Oax6x|a|K3Tz8KYa{ZL+=oic7kYVlz>k*@7(g(f!-J2%XhjDY^W=Q(b1}?kMg@;C z2LTR2%&#m47{G7?tV9U+@moKj%~OuHpZ3HpqvWy%Q?&9p``;l~bchCVmwBQ^fVU->PFdL>y94T!m9ZI1 z!sVxBw2*xu?kT;Jg_XXe0XP$VAYeX3PVY6(JOkZj$|DtmM{*qC1Omo|imfzOn|#oQ z4Cy>u*IavP9TUA>TDVq~&uEAMP18GcK9{Crp4((jCfs-h-0H^L;4Zbi7OD5#&^bGdR@KeDZh=~B!2spb^|ieWLvMY^As(a6<(NesP-l33qjD!P zA%}4fw1HIhT{l_XYq-)p!9CmQ5c`qHLl`^jtV}@d@sGj#lqI2tmw|CdJuO^(yNL=! zI~MLUtkIe2v=tDaBoaJT`|1d1cLUWfSzFmu(sry9HH=~R=*$~0Kt>1hQk@{6h9~IQ z=9Qh6m^}fpvClKQw@Gl0qv0w^)eDul-Tg(u-3uaI@#nzYGDy$7p|Q9hVk(r}qA=-h{&K zYM-z<^-Jm2UIg|t7aOiWy?3Sx)Y&##@ZuA4Eck+G{wpFI8L%aNU^R)=;L#x7DK>ih z7n&d$)AgWa&>%>_s7zP`qwTK0!zvjL0t`bUZYd<^@9W`|H{Jvr9J1b&qri8+JTU{^ z-`t^F27*|v{{4v;7PIZ3gjy|ZomAUQ(o8HzfqSl3h|YV9RlDds*;-U^&TMPFw8)gB zd3ZuWGgw$LH?5pg#Cs#ad1%{&C4cSDbD_}%C1^Tu>JX5!7c_tyW(U(@KZek#0x>_Q zL3DyA2r%g>$P$eQ0hUZ!?Lo|?voSHbXw1ZbRUP{UIHO1O=t#1C?=bsLZ{UF~JV54qyze4@6&iGpN{wbLa@*R?W=y zHce|W3r3gm!aO?V7GpOt%7U)G3oeLeC^l_*-aHK14O*9e;pGr*6As$z8tn_^XuE|w z(z(2L4&^u)m$(B0Mrqz^E{Y}cmi2B%p~r*AvfIZQOwh~-nr!weg0KKBXG?#C2=E|! zA{=C+yae??4>JrXcg`IuANDdo{Q?cD+#ByGgWx5xJTOk$p*E1?&bh~BB6 z3r%J)Fl@{s-Uw=#2b%^Z8-baEnnBvL zLw!o2aV;mG9Rqg`VZa01f$i6RPFn-1t6AF+%*lKZj|kO%(y)s4yWU-UssSs%iVjZB z3+edgL8!DOppw;m`^0@~be15#u$BuEgr};~#@yk&fC|u>P3R4vbB}{>wCjX9 z3z!ZTKY`hH<`5lhzA8OOpY$DpHntEfZAO4Cea3`OP#57M zM?q6n_TbSuQ_6*C2&%cj@)9h-$nq6@LTdLMZ&^UbeET=Zl6c^@#A=A!wm-I?FJg&Cr`?{mLaTt6MLn_sju&BrWL>MgGc zqoP`3(9e~&!+wQ)*IbGl-fwF>AdN!wd^ z+W4YREjl|veau&f`jPrvNMOL7rUtA)-~77YR9fJ)x=QXPs4eNEt1=dl*apQbB@=wo zm-m*Jh^T?qSO~zLx5iPsW$!aTDNdRRn3P_fYY%8gi#D?z zroqEN-`%%h3$c9=45+CZaP@(lktVpEXq+3cq}hNumHd_Sj9Ngw0Du(Tv0Snr1Cy3rq z1{shb4RBUTa}Y~5D>idy0YuZs@JcKP^iQ?fw{J271niBW&jUf*(g$t?vIOO^* zO)!HX2^0+i=n|lfRy+EkG{A!y{B@%26cWG?TCn-<9td7e&^an{ zCo@(BcePr@5C&ZT`p&Oqyh%h|lwUc$(ps$ft=EJMRa@4fgls64ZoH6FgSPDO)J^$(!ZF{04aBz^y3*FQ6y zM%(nngW0Z-Wi@#YJn;~^sJ5D#0nFm@n4pq6OXO*ow^X?GapQL%X36(<3a)*tMh~W7|x+~79s$Tmt#};2HL@B$hK^L(8 ztD-Vk$$N!Bd+sQg3~0eQNT*kg9snO=#Pt@p9ebuPnv+IvB<7Ew`UqMP4`Q6BfB*v# z!kH03w$Dt&{%)F7#kq7Fe(wuE!x*sSH+{T8fuPZae*D2YdUc_H4u8Uq9-Qi5T%5y4 z>hWuRyMNP;q|Jef>X>kd>evdJkX3_`D~RAiB1KodhPVAy9Tzjeo5|Y0aPZr%JlBth zM+`4v4Kt97`>t>F4<@q3M6(N{u`*fg;M92R?T5>v=$I^Az7gMaivRve`2+aMK>y%U z;q3G@{)AsOJ~NE>v{&#){e6GTZ|a_P$al&%vXm*oX>nkuQ2D(fg0~qv2Hsc_6P7U{ z=w}j6_kmdzg0Z69{B>*+1mG(o0m2(pCrxn19gw~WwwLv}hj_Ya9bXLO8D?gzSQkMX zRJ8}{ru|yGce?kwH#1B{Xjl6n8Y7&=>guC6-*<2EggWYLyE)A)2}Py0{T_h0^af0yW6j*t@|zLeqA zGfF~C{rSOPK{S9id1abM)mC??+ap{nU`eA=iU3y&Q|0{XQ|QW$I{uK1yIuZi|D;MI z^xS;Y4ZLSb2Ca7AKk!03y267O0(zssV!Od;7=ZQ!mb}4E9tMldY?ChV1<|;yWw(}k z%feP@=F4DXph7x!_S%c!`@uMf=TM5;4%CGDFa8MOV516GB^rQr2$;XB$o-q<^=Kv} z*7E{ZG(H`tG7*~D&Vu)aN1zB2?Y73_lM}7babm+-!$UL%jn6F<&4XS1*sxKV!|Pz5_OOH1Sbv5IkO3-LKLE}e$6^ok zg0?`6|HUo(fbHJxzM&0(& zy8JxYARRlVuKF*(qFs2j(>G6mCuI-vWm+^#C2-q2zL)Nl?lycb2%3d~LFWHnP4+$) z^bhMwOJ}QmM5u-Z0Eh!Qn3sX`b;^8AT#wCJwFXnUWW#75dafbaOQ!L0Y)3( z#pG)71{+EP;{q6%H(nS42UvLlrXdjIZfa4|4TX{TmuEf%k8=YXSpnOQu0Q`)0q-R= zeY4-$M_tZ-22D^L2uVw;iM^HDDZ|kabt^P}6DSG9YTA+v7Tg8Kzy{h986R!Z5MDpJ z`->6MZrxoUm(B|+=Rsq-3ch%(rJ{t9VA_(iksXITM`*cdm#Wg|O-Y+W-NT9!GvInsGm59!m!>oF#JP^iQFz z(~dX)2yKAM!6v%>*isDS;(+H<+Oo=Xhq0iBlq%ya7VB9 zt5c8+b``t9jJ#(0l@`4A$%b+d{+_kSt zqhjds-Snrx3xbAI%MXFN!I^zn=Q>hslv^7k+tD7|0rObq@hzY0Iu{STi!K9x6sntOf6qV^}zM4$$@H_p9+g@HOoY zL}wqpV+1_p!Y^7_Pk$IXSc0S zcK%(cp`d^yi;^s^z^}O8EG%eEd)#}l9H;$KGt?}Q5r~1nLmjFty4zNuoaT0P+A7RIH+jdCHD5GBc6}5ez`kqX&7xWnP9QC4x01D~3TePR|22AhQ|9$w0`Z z=jU2Ov%>migvF}Q4UG8!RIdH~XWA1bp!06HkXtSTIR72zsj*kRRTA(L!E@W-1NMyaOa>=Y8i+Pa{q8>74rqzeG155A zEEO>O%@_(?{9YiTF~=TYr+$7i!n>2DyPt6m1bVrOa@%JH8%J1M4Dri_qu>9wINzAr z7d5rF*07e&RmWzx>yOL4Nf0V0xj-gwz<9we#z0pGx2g_vfy#n2RHf<`(_@b7rKMFL zG=U$_+fd*J>1dgOT-0=GZ%Mw<4!;!cG< z*Zvq{T3NywqVpN?Gaw6xy{dsG&;+{p(D~;X^%Y}a=YC5^#xNWJ?ZJVpVS<1C;5Qrv z)OP>$2Whs5*v~uHmF3Z?eW0iS3X84|#-H|6A(Gk0{IF-xwj8N;UJz-4_Fh_8 zXg`mOu5R8y02^lfKY#dBa4sJ(+6of|+$tf5n~cxt2S4#*Bd;t-_S4n1e5gS=3=|dj zbu1+@5h`Z60>DN@ux-wt?h^I;JX7zY>25=$@=@{R%?B}59csaYQW%vv8745MV0HNJl#L2 zpS>Qtzy8%?(Ql6S?q52o1Ib|rq9Bxcji54=0PW}IzxzZQM%f}&+2vt^Ac%6td70kT z?_>{M#Sk>sO&1SCuklP3JB&gVP0-9hI_%a?Jc7oMbfj^1vqPMYdD!G}^l4AtHzMc3 z=*9h5Ktp>anW0?LjSgD#(#NZAr8Hq`+QBsK+staM;|t2YE4i_ubjaTyd)5`=zn*%7 zEgf_abI+|*E4`Top)$k(1dO*3mkh)lfngcyC1FHC`JIU9-MCX~$z`X2cvLOJLzkt51e25Y=&)_oK@F1(u z3O{;9dqQgg6gt)rv~=t+I1l~yCu4~ay_CqjF?IoC9W(32{ z>x-Aae52pBzQ))$po3}Y0AdUQv=DINp1-~E6G#>4%l^TyN{Ih_thPw1jFX;+{k{+o|P z1Fzd*n$&fXl|L?H>egC^S0{^oTe%t59Z+o>|*T1lcXPd?A-zvsQ`7~^t zT`{+yav2=lVtr^(Tx4;sJmDX08I#&m$6}b&4t7Ay} z<6#RFRnSy`9;M&6Ko{Td1_xry&pq_@lQeD&C+?}X4+uH+P;~J)-O&be;H!_L_cPkZ zK`D%%^c66HV+CY`S8OswG`-y_{VH*K*IfJ1aY#Ca)1%D1Akb}pFqQ+3yMm?KM!}HZ3LVlLR3c+t{~JUs!`g!3jr~!V4Mm# z2$}*FgVb5jXziTzW*0SUCYnHIMnIluI``DIwIlDX#5AMnGkM}28t%K7+ZqPS6Zdk| zFPeMN!Gf^W5wWzPj$mCVu=7uv&$1ry(q0G}_0W+9}G0^a*9L z;kp@Bj6R^-y2{rGk~az+hT0=^)PBOQJ?l)D2&%GMs(B^g)KjztFqpw|nX?U62WmZg z9}N^%5BAmlU@CW@1vQV)IztNn{nb~Td6%Fe0GmB0Nk@H7{KCmMp{oKOJvuJ~;2BO= zKZD>d(m@P~Grs}b+xF%KR__cDz+-^g2By(%80Vr(q_bp$aaC7lrD~#ns428*kcy|C zt9Qy!=$d|r4K!bAX-`VGELLHuimD#m(+~PMUWuJeAR?0QJcyuDPP2~#{gu@mCVx6K$eJX5#PU; zyQ|c~d!-@xrflLre7|)6y+z&yTh#9ax3q~Kmv#_6BfRG%!pxh8%9P}l`SuQlc16Bj9bkr%Zt^ys{0>um-$K z)4;o>0j}JVP`L2bn+|k?RiunncjiEeX=ii-7A&=085P`J`600JxFK+WnI~9dQUMeT zpuawJH%+%3w-BU4iV^tt*WO|$h@nms=_t`PC~6&@F|Nsz7k(ilbk%HJ(Eh`qySQ&; z+2=!HG){s}zYYd8T6=m!cn^T_b_cYG03TIBmkV8Or4MSO+RswgU>hyK2?j^O*jNDp zdEKd75Ybl0-k{)03z-E#9!UF)OB@vD6@3I0r&@WZxHC}qO zPlEHzIMzy2E{pC0cr)|?B}+568S?Chp4ku<^E+0)85}q?1~$fI=M|>s!S=(u7p(+3 z5-6nQ6D+{Gq{AAbl*@N2?*?a>?FaWao;1oRJP3-~$){DDcou^-AYa{Ep$qyvk3Xtx znN?$`cSG5chW1D6v6dcI4V57Qo|hjmE1cZ@j-Cw-mgbtkjoZjc;HyEG9)K7P;u5)3 z8-vIL5Wv#(fkpqia%iM7>8$kMQ08U52UG~?Vy;5YwRn3)}!-p8P+(w-#%1yH7( zWfo><9Fk6OOM}HVzd_#eLjU&Yqb#!l+S@=-g5BG@7!8cwg{>g2+AC5S(TXl%${b`F z|MRO4c0v?^3_$E>S#AS`alHR;AAO$a0flD)Ti4$JXF3DSFo4mi0%=kuAA0z5afcDX zvjLh7=x5Uz#Bm*5J%fn3BA_W5cbyqv;r(s15GOueZjENdIe>t@i*X5D^M2U1qs2^* zmfn6IPU8x`dJ!_A8jL6FU@W63)GYp{+LFy=2O0o+Wlf5Kg9 z&(TkZLSOBGbhMYd^7uH~ujb?vsStZfi$;gDe>X%fXl40eZ2+X>Dwx0sVo7g#Y4@3C z*0Zz-FxDtLP}`*TJtSIQ5SB2d>rirzyam1q3T4HNkMvpOju@DOp#7--`d&1>q^rsj zl8)1%Zuci2p^J2ETBJbd_FXM1z*(U;KmhZb%{3N}(HStoh={Dk%TGaDbaRw;f0>t0 z-<3C#Cea-4<%)qUhUkJj&B&PJ6?B|seG()Uj^(yn{`H^?xWLk%9s!ggY#lPDZm~%W#(1U=D2)we0%*X0zVcWzLt!tnt-57|$E$&H zjwU%9)w^k>8;xe=)2+X|{aPFH2 z1I!Z#GQ-|1@M}K-3svdllg)u_215=A@Dm|CrHTs!xE6r1I8n)?ZRe#2Jk}UYMKYHI z(COZyf^&y}yWRn18>Eg%Vg>>2Ai9}Tt@?wpfY7uw09Ov=g>SLaTZ3pq-Z|Y1GTl^k z%$1`Jcz}910}bQF1G6n_mJ*9tTa=01I_a2h#&|afnAd(_9E!ttFM$slf)#b1dUXu4 zkU0wkmgki68tO)~T)q1r3iNr&A@*(-P#DM4-e7qwc)ZGOa7Fvd^N!3DF2rzg0=$+X zkPhOi-W>)S&(CoI%h$mhZ9_FC*aEn*iq@*4t2MQeZ^{16&1{bi|72qk(+g zr6JrDqL?+RQ17K>fX$lGTs4V3njtBS;rj4C@F*U_pvm^E41t&eji_1^!T18UoTnXm zGX}cpN&BVXera+Mq??a#Fr?Q(;UFE{L<@*B1CiSM6rQw0buQQrC}270yGL87acQ<7 z7y944223!s7GM?Znl;XV*$);QU=1`p)eGJ&9pGmUpMR3mErYJ#SDPgR3lMo;Of^Sd zk0nx2C4y$)#tfCM+zrv_o|QqJhcZ!|zIzmWC&Z=^;@>{yJgT-qQ)MP)`WhV@2%0(n z5ctLCmTA7;GkdWb;NgazPF`@t?iSN&Z@EvSpOLCVdt56^k2{lT1mxv3C!-!+2cgVy zdpCdMRW$&~h!Ch9Euy6|hc6<`^zq%NBMybK765sb=YAEpEqZ+H5EQHGHaDK6N-nf{ z=R=F_O#aZE^sR+-*0L^8HfUe$Co2QeeGHHw1Dg93?FWp5MwtJD>%-v2ARXS&w)K{- zOwj?(>ls{(4&V4m=6Y2-*o=qvdR>LA9OCZ9r7<3=_q_$nKtDtW=}7R>)!O54i_S&; z`SW|j7{wKRv~q(CsACVHb@?Y?#&ao?Hjr^L>>ec&oK^z7xdoz##j_6sgLY+0_|&FGb#6XmJqt{kG8T*-ol2@1 zUF-BEFmUy0cBfdTxUm!qGG|Ov66Z&>ABRLw2ZI!-pWrfGKojF8lMXadGf0ODL21|O z-MYfK>Xw$T-U)@N3ea`md?q?LXY&NrsNB6JaQrdA^tZG1=bGX{0)`mxIDk>rp}GQw zNWXcB$^)x>G|dXZ4)%ln>29zhke!EeXgrgvK#O=NYs^fSEN}3{H8AeUvOjg_#9g`S zH3Gw3dwHy`$?V)iS9>z31;}+oVfv5yq zQ36ykYpa+lT~5N++|fN+kQ+#QTYxg;uxfAmngwi_X{mald1Zt7fK-$~+Yjyc6qWB( z0sZgC-@p-E?SA-Qe@Aa-)4UrXuDeF>))iNGs7GEOM{a|2D8^e1raRhA%tAzs#?eLo9Y zI5VM7d)opE5Sz`*T949FKp!U&6dZZZ;l^Wn6N+tnJGeR$8lC730{-ol$HA>ZQ__(V z1IeJHYT=s2XK-Bf8z!@0=zJ3_Kc3-tRgV!)(mq(W8 z5HIY_0Xt_E7u9G0+S^T#R?=ivu}F7;lx^!~Q^V$YlXeCzIhAHZ(A)w?T^pd)S&wt2 z>-YyEy;ElC8T;K2%S?w!KlozU?(f~8k-+;cu)%B776J!d)5_(L-b`2tV5T!15^4fi zNmdQPT$kvxneU!x?twh>Bp6T+VhQ0I1tlWXMH|zi(av@U`}2bj=Ki18A7u9CE-=P{ zhH@HrByt=klr93&ZRoCDAl=t_4F4{K=Ho${vnGc zdPxu${mq?|-A!oNjkQ;4pBw0G>(qxu>ESw>zWm)-1$Q%{k1|vM|MSm}b0ckB{rNXj z!80}k!I|%-G(vv^*sR*M_JK$fbzwt#Cpb0g|zqc zacML%D-A_wIpQ*bg=80SMj?#@*oersy!a%IzMjRXZ%B79u+3iR$f(_mYIHYh-`wh* zg!=7EU>ASIi#UO3P@o-jnKs=IMnu;L7(Fz)0JdSX$e1n%C4qFXtO@jqxLRP1RuJ&4 zZBae0yu|86L({gsgJ8jntn0fUcT_os9<_gHrXcMHmDQ~m0pcY_M1*1;KXzya-7 ziz|kcc|jO6ShZhEV7A_T4h+cJ?gHPenq$aW zwK(j#4Fp)fq7MP%)H_MhJ)zx^_q<3Uom2r(~m>8wg>D zx-t$|K)_O+NZQb<+ig2KQQF`w_6#!}j3Pj-d+#vE##{!c;QAww%v~U#QL`qxog1V& zb;f4iJQB@e8LABz3C^0utpHqS6X;;b7r#j3)__V8;00S?hd`W1@R!Fw3b$P448S}n zYgKgc)-7Ldw;9BB?5Ko4^(h+O4lBLIkibC^SKox}23e@IvDr>(?a0PQ%XcP zg5Y}7c8Z*+157M#@sJ@HCrInD1P5;W_E?biOaS!D`#Jd1#gF=vOZE8TBHqD~|19A< zWw-uM3DZq8e(O{rS>?S1aCT>H2C5hiT&gvQJ2C(I9=A})zBsT}I{ehLU@o(~l>oCM zzzbAWbKNn>mCkD)LLR6zJ^7flwO^$8?_Yh6)()?6l>NpF88RAL9ucM^&CWqE`j87}idnUGfLn7ZfM<$GaFr%}*#k6etf?sC z;Q}smnR_z>o&3OFtxFjfeNDUz0J&T>P#z0bsxoMG3k}!l7!QbM`W0y4f%M#PAs81Q z@~0OAZTv2N#zLhE?G99Xm6o>9Gw5CJjhprc^?`uE4DHL&85dqS{WhBMp#SI9ckh!y zmV{1wu(}4Y1nHdb;vQ+8U^?>4r>;H*5tu?dxtoFkYLli*&=Yv&cq8X1WtvJJ)0YLN z@*SF>AA%{#ij=)>ZS5Wy{n{Z@CfNDXOYhVY0EWj(a3|Rbu>g$h1ytLPj zJS+LsPtU$*!L`kS1YDN`Yscoe-bV-8sLM&`@W~IMWLoWoswx>4g+mv9!|RvJfn&)c z*N(l(D7FH5fl?#7+GGIS9u&h%e)Zw*=bLO?(d+;LK1YAg&7^=--a%8-LyKY&6?8Y! zB><13i?(^aI*@?H?qrZbT!Cbp(p;FL)z4j2e zfMKjX>#U}dC5TsCk`ZM)PAxe1G~}6w8$D(Q_BP(xrq-r?nZ#;uBXUj^#E3bVD%Cqs z`(>z8#0W$Ny~7~^jTWBHv;*i`W+QM&gm5d~!_?)bp)$6$hYv!Udu)NLYRb6*#xhVM z0(_`hSI_@O)Hp78KcaoIkFmp1I@L{ko>lI~E86!prnKj3p#9A&C5$^eI%vxXOt1#Q z;PCe_0CxvffXvQ43m(eyL~A?yZ!a)fxYu??5K&DG7&?$9+foj3r+L%`%s90PBjnTr zLzPWUPz1;CVK9d2ZSO3oT2~Ad2atPApp5?4i|;~-0NFEuayWfz5g0vxaJaD}fdyBf zPLT#fhg+VFOx`o4-5`3r<$%KLzlOrt11!`mP7ytIA_r<93}}19iU615sPeMKOf*6RTGF=I+h{)-0O7uoqT)K0@nKw+@Npt)q}T!v>HwR z>Qow#shkR;_ZSHcpmC7eYi91%N9kf!*#`2UvvTNQ7BcIBz4T*AH2L~htVUfR7ZB$Z z^hc%)GYoam*`v}r`^;v5ssEr=tQ%7tm)-I-K7EPqiOD-) zp0hAyEo0zAL5+!{Wm`c^Z-4q^E>y;pX_$a47XBbsT7hj5BqKjTEihdl;+|{&_Q@R( zH2oZi9@3sxx;j(EO0&d51NfG63V@SqKSGsw{8O)lQrdWhF|!{z<5}F;LA@`_n+c#j zUy(7P{p2N+sRgumGOz6nI>dSc1df0WDKGN!$z6iP>p3Y@?W1{%Hj%}aJ= z^iFvVGbJI60mtnCCtn5Q30WW&Fia}zTVH~rXGBep$7-O3uOg-W_(J+auRt*gP~n;H zbnJ5|YGcqmKuH%qy!iS7C{Cb?*$VJFBQPChyjKB?rVPFJ%6(8Rw!OfOW5EozWhhaE zaE6-e&1dv3@2{WNbq;}8Obd8v1`tpp!l0P}+%`U(>!_S!gZ3mg3 zpPQq@1PnTRHHk7jW16#n{SFxSXWO4Z`?s`#HGu?NY|#)H322!B3rms4@z+HPw=w1F zxah0@{`LSuU5R0zyP^f~LetwM2&+G$ZF}3~nH8f>SJAdm0?D z;|{91EUxy{17P;8Jt_wcc0b*tmW@H4yt-KiejCmmM#oq0f=%lqi=stpkFz$&)cc|2 zh2{1@FkWc3HISgozJC*1n6!c*)J@{jJ?s}$`5A9Pqmh^CA0LqSL7$ODN3NWteLByI z_Avylk7|dyM?x3y7RkJfRjYE-M?7^+S6Che+E2K%GFt|2dH zWEC{CkT6q-P7ts_(@%n!1Oi8h*dW?1gf$76U+L7oWXs6f4?5uoK^JI$0x!A9U#2 zYxG6ya)A*9z&gM>?dF!QvQql3AhsuZlxiX)z_KlCWrH20ZWYOxOvAx$U@c>U>h_t z?>kis$?L^AbK5F`Ses}aKzl*8mT1M$vpW9EGU=@eY8d00bd$g)3i9TQGyyN8!xvf# zFW@ji>$*oDJoEX0J}OEKL@3wAfCrc=04HDT5?%XQu@c{q5HywLDCQWp2ji5TCj;D> zc|f%Y;U&92VqtjY`4}H2ai+J7BtT4oytMxh7D4m(m^pDbWH*;wHq-zvNEu-^&6I)# zjyO7Wh1%{rX=&@5%M>6Q2+x zE8qQW*pdZ3qC@$uVJO@WZNRR~5j>>1YJ$#70adqm-5!}=J%|2%Za@3xA#|`RU3n+W z1wx?JdA+6Ge6}{xwg&~YEP)S}fW^34uUkWAaE-uUAH91Wf?hfQo^*Zj2o2WF1naA# zW-9&QomPd(-~C>1LSbwP7Q+&G9xV=V$I+lPX&&6$Rl3deH*ZTXcnZ_#?E7FUcC5Hc z?OlCH+Q|&m0@{zGe`HzVK2pp#8J^qvs458E%=1$(ChPs8FwFtR6EFuFImlZ*KyNJ_ zdq5hTld&%dfUxsg+bL7K(Y|Wcl+81==j_a9$#L2Ta#{kTR!1$Gxj5SX-`;yg28H+Z ziL}%^XHvU)9KgUn#0<2UmX2@;mG_?7-!il>J@#{S0aV4xvc7)&4hTVT)a2T!_pUrX zSZqv_Sx2RU7wW_Ij@fo-{Q2dd)DO97PeB@KlR--cNL%TiH__ay1*|8*^Bi>dDf;H_ z87M;_?RP#_p#ZGP3{vgcU68C0G+Pv_lfd9mDR;;fluM6=2v2W=8Jb01{fm3FKey7R z&C0NH+{R2V=zAiaLtH(Qdc(8~GC zCqH*!iFBw{k(pUNSn%y#`NkA2w;@*qRi2Pj$@C{Lo$-HnC{)Nw5YZj|c?pP*!YBNg|A_t2f5GUIS&;Sz)0%K6%SHWq>CX14Zk`vk z|3!p2XdikX(FdW#oOw^#5{(s>gwWnCIe_;t15g- z!klJkXH|kRut=U5eh<~A1&lumE$@O2Mh3sMDfF`1WA`H?yjH=SK=Pdn1~Km-%M z)1`xHF|}tkwz95%4&h}D2J{!DwW&0cjwD_m7!@(LCQ^8SDddUITUeL?uEiNN2MPqK z5P_z{+bAV>F{3<~riu+=AnK@4UWu4;M4wHovN0X4Vi%eRsDlLt(EN4zGib?nJO!w! z+G3;vq1QfZx^zFi2SkD@Zpm0SYAt0n8G;9LO%2L~6l$yU?K~hCR1MNGEn159ekrpc z+B#OcZu_4ht!{@m_rXV!WO#b5!p3^K1ctlJ#W4#;{muJQ}3M)4Q2W*w= zr4_-OMM1kXf*R+S5(=vsr(ANZsufIrOYRf!?6pjt5jD1Lh2hW0uk+`jjI{4Q0{izr zzBbEA4uQ50_VE(QUpxYS=5DZ*4lv-W_eFwpoeg@+16uL{X_kL;FO)nG14sKBpOGOn zBM^-ntirIQUHhgEOS&LZIT5YS5w2Ldxw}pKx+Xf9(E@W3ola#@+-B_1*NrBRNjG8bySb4c+)%^=v*`W!}S6HIQn5j1E8@mo^NYdsL?{KxOuq)bw;r zLME^KD#!4IBG91$Wpn5P#u<$aWaV3a`4dsWi~sal?8yhX%ZA-Af2x?|t}j0Uwh?*k zDF|SJUix$+!TpmwT76gsj;RP9LzqH?|EDUB>4CZJmS zgK)&9sPeen>T^=H%)(D0|ln1iY+ z_(7d69s&naTr2vt`rU7pvT3Y+n!8R$z!$1JoTZVx0m)73@Z08^fl7Bq@If-=0BA|U zVD@2IId#rgpB!@yx%mrwbkxydfEj&B$>O&HnmI>b1d*EZSd=1i@*N=nP6V{FH=NsU zGC%WhqI3%HooD#>&L{dy`{*Z-baU1yy?5#N8N4qyF{nhEtDG<|y(>VPoN2`lOwCLS0(6gH<$vCM=M_~8 zL%zKeopioa(6;@_2S?-(&SASOy6~pOiEe0fj0sYtbgNmpY`%g_qD=A~@hm zhp&8)-N(3R^6XipF~`7N`%0@^&=#VNW-Ia0s+c|0G{zY~oyP5Rqzn5%D)@#hp##cC z4$`7H{XzegJF}r!`%f82H}A+d_A*78rEax$wRyRD&+bfk?@cgXkrr$6p`|B4t*la) z-gf~X0|7R%3^Rbi2P}fL2lPpka{<;lmkvW%dar{wfcm`y!GSF=B}LFWUYG82YL#X% zZzgV{fAP{F6cs^@P`MVsnL!D3iwN$8P3*vPL~);@mVfrmYGp-1~6PZn3eVxySx&0ylLfS5$>;bpvk0#?cdUp>!y0eFZI z-lazO_o?G(jHo6s*Kx46(nJ#o2fBhASTjEH)(A}i&{ZuIH~ zEr}7PQ9sdLCb0|1HP;=fDs1l8Q9|3PthK$ z0#hzK`BQo-$03!GR2Q%W4paw)iK27YsOZ4s~&C;s1X6q z83fG`v^=1^2(7-p^U5pP<+RDSuX}=bgMdlygNY|_i|*2OQQU1xuD&^a0FBmSZbHyE zdHJmwbJ4vac%cAk3NMC8&v3ITT}^?uvVTaW7#GY4U7x25lAOKwc2LI{ik|xRJ_v@2 z_MbThYbPU=E{p;RDh`Rfti2w0r!mcVjv!js`gqC?odFc>?U+mWJ}S{=JPJ1DF*VDy zQHxHlwh2bd3IwEUpV%*tyk&dnrzN zpo?}gvzU}NSJIXY#+o@Hec-$s07lv;G3N}!dR*PlO#Dq~7tAh>PFfb&-igTvr`f%gxT)4_x89gwqJ-6-1 zy(4+j!Nj}pVDRFx7ie~6B1RvRCedX4#M>4}pMmzt_~7ga&+Ve%DAU;621 zTbLGqzw7?uR%C8zfOj26!kFJGXSbzWRm&;Xq!LgRs3wnV0<3t+RZya| z!H>KK#;Y3B5j^AX58mxIXIa6ny;vSW)7fB#31isM0}jwnOU8^kf%ez#cG1s2qb$02 zrG`I!q#s)C{qo}9h~v@#9$%^$!H8pnh+LUI;X?G7)n`d;P`yMcq9bkW+@)#o9! z`wA0>>(-W)4rRoK)}lv785oOooXsg-xiXfKz6}CsKA_EVQY8Z#rsZG_3s%?e@3gvh zho|+mw>Y_=NCeky4pONd!nS~Uy9uhT%VKcbNG~`ISAF#p@Fl&k>+~a+9-359lS%W> zl(nt6ImiM2-3#&d3>1Ld;00N`fo~rHTe6IhmMUURp4|nP-oLUBz1TkZzaK9~i0?w)oR>#R^{tT%P1e+do*ud<6KQn5L;Y=}mCI+O6q!`c(H zc?1Kv!4=G8(vi$fgFn69L+i0M#;pLUpo5@mzdHJY;bfstopdw% zeZIOk!}EZesB7x@o#?ZZ;Ti9<4{HxwKyv`pC*8d8u}=oULpGhkb6SkYgVib7ZX@Pb zc*Rwo01S`wz@DtZjjfXTupTc)4$wDQJ0A&o^Q>MVOG44zexgExC4Mw{p+Iv@DUYjU4QGdZIy zxhBrM_pI+eP~w(#V1U=M;Q7D?h?~m^0IL~d8Z$vgK<##^jOID*c^(F1@r&DN2~x5l zE0}gVj{Xj+%8+!uw`iG@8#DI=Uw*~~3bx&bMX?p(D}pX}wz>Gz;hHe%n5SR4=mK6g zLpn-4K+)mLksX#R#>@)A9Gy-xFm!czLfbp0FAdFNP?os^xGiI{SCxV9 zK0B-vJFnfRJ(`vmbyxwj03|u5fD5uZyP+`Qmr@#Qq;D3&3zW$XaH)(d9p~?a zs^S9Ly!P;PC^QD+1K10+t?TN+S(#cG#&-5E}uY?kEVrE=qXz2U;c2Xbo)RU zsT^lA&@Dckg^@$EZ`+20>u{d#X-6Ypxe98nIaqsDWE7n;6;KM!XaP7kaPobTI#12o zOZC*TfgB9%trHEk9B3-y{CnrPcwS)dx@cH%pY9CkdACZCo_Xd;BmM5Z<0MT3VSYjpOe?Mpc|vV`%sWJ2iE*U3_4nxa-CPtedrRjtV1A-UKs2lcX0yDj2on(zfeb1YuHlTv|F5(w@rvub?!zVo5<(LD4nhbR zfdEPD8erIWkU)SIkcMFx5X+2a03nIRX)3$1>o~USG;WmR)aNv568pr7Y#+5wlXE0* zYGT>)7N>UXle(_clXUwJ`un~6&10AuFmZ?9z2E)5_uhBE?|%2*_h#X}(YaRbgYr&} zkNLpueH&f1TnUws79MJ_@%O$!urUOMtQHNXl| zKE0xER6Sbre*Fz;yP)i^V!7m%8+L4B4Y}h?W9I4y~hhVon8aKTk&!MCelA zF15KnQg7R-EKOx^J*$>S`z>hd5i}hH?HiN5tC@Ma6ZQ<2lu5&yUrwRn!)K(`FwS|G z576gyC`aNE;nGM^83EFm@^y$cvRybk)^QRN)13~_|GUf;qp3Nouc=5jsnwUtkQ99? zEOJp*ZaQ}E_RR`ZKmXZRKL7cnw19w{xf?)l)X}jMVxCERkbP2kAx(UQ%MTP3stK5+ zo-~iL55x|7L6abFs1;zerKzBfwlW}hf!LY@0-V*io)amXKw{jqEP(-4IpcKgq22A|pjZ%4Kd^i6(KGEMnQuOd8bdpE z8Y~Xfe|6m=D-U)u^KXQ0vcb;4s{H7h5e0p$DEpJgP=qru+q)NoF9$(TLC$>y+vjgT zb3*$K-I6hxQ)3#^!P(PA29|e6m5#jn!003=`t}o}%FW(-K)a8PzCULGT-F;PoR!Lc zm2j$(kD_6pT0F{t+UA5f16mjJt!PLB3Fusce(llakWWZ`F@i4Jk)&2RL;1NGjr7C+ zc;WFRS2-7a1q5VC;Yd0sf^ZrMcO4t%(bPLZ?bR#!%*!9$ z4+d};N`>}pm&LUR%Fe&a-nj?et_37G9DYen2K5AKi!P2Ta+N~9Ds^zGWs86-a*=Ca zPfG#H;8Fo+T#Sv-wjI*ed-rj6UcLx+YPYn3b0)wj=%a_qhpN_AQQPtJ7k=9O*|(p) z^JB&!P*@_R@Cp^{JyN}TrOyT_D)BOh*S#RE7AcsIEp$uvt8z$Kl$sIOAJ`thw}H+& z#sEIvDUI4=5H40}KWL3ir2=bC!I3q?qG5PB(XFBkwHOeGy9^Sn*lHmp9ZpF(CJk!! zouB>ir!~`zQ=s^_KLEcV6>#%N7&u)vaz4RvT-uwY@a9g#?H|U{Lp_&O4l2L2UFFb1 zRC->%!SO0_eQS8$UOwhC>q{*w2OLyORqdE!lcT*49R38XUm~h z9q_2-MF7ysiCrC_`%Ed9Z8D*vf{zz$2N)i`AQLx4Oo8>>yPuBW0u6&|>C81;l~psC z;PTaq`ABM^d5l~J9Sk)iNQEnPsnM#HE#y#CTBB7sjB!wR4H!VTyBgaxaP$asNxU=) zk4C{=NxQni=u!8c0n?#Yds-TJF~J1@cDQ)}aO*o#4%6E>ejmiB1RNY1>A4FabAmmC zVbNo`z(X<@j)iei&VT^=V-Dvsv`-qqDQ!Q#W2$9O504lE*|m4@PWI*v&Rfl0nhymS z)#4nsF=>bT$%n0iNVQBDfYOPX6Xg|<%hs>INts)tFlreY6j3+B1eTQ$aoUu7k270 z11wK!F;X1ro%qe)PIGz6Ln6SL63)A5S%F&nSD(^bL|C@(?|A=a30KJ*%ifhkM^JlB zy97>x6a?aeat8F~Js>9MED*q^?V!6)YtIveG#WY&PRC5=XgPR6!J&iPdk|C~+EtuQ z&(D=j`=|lvH>q`5x9;qJxe6?PiFTdZLl4*q(osA@S1Q-*A{3$c^r4#!o^yK*=LS&n z^q*|z&a4T#s4VKDUe|>)k;!lT47CzBSoT5M1-SEfQVOSzkS5wY&AT}gm2qav*@VId zeFMFdje?L}QgRu?wI?(~NDkQ{tvWwhtlZ@7$I#Z%HSR)@ud*23A_a83n5}@ZKcmKq zQu_{q=TFWn6a?gO9<3tN&9xhZpgbi_dr@#rbi}ITy3oSx+`#dl1*J2+rh|$rEY!Yo zXi6=Ik!uCyH!OFIT1!xNC4ps@_f<$6=YHbu zgG*PXO3P$__@Y$6XSJKcNVRli3POhiES}-Ex2M{qa?VTv>L)GYXwceBI%Ny^ER#5=p`((AwUpC0sNssy-hK(C3uIXM{SW@C z5yE>nnyhqZ&IGW5E~kOfptT_Fe_c_k>U-BOo@ST>K}+=wN? zYb_6$YK~&V?pj({`4Mv+9fecw0UZeo2L~#6tZ_egE6Ql00|PX(5!44#X^+#n^?33M z3idM#0umyZ?tBZSI-jK`n7C%eAPXak!-yO_$#`TNpml(fzBky(F|?k3^P4EDuF#rJ zGJ%>ChXHWS(mH6{q-EvJacXL4`@_v2f^P!}XzlkOqnT({U_s5|@bU?!GC>9kYh~X6 z3Qmc(CAHoC&ZO%g1VKoplnhVytHTb71_C1WMhGf;PD4yr)A{fL*&(?nx*k&3R9o(= z-)(_ZBkh^YP_ZVka!yn*Xu9N>cciwC5aY!Bw##`8jYb|_~oQ<{2B|8w)H z8|{qNb`afJ84{ANApY^1R9OaI-Q2nx(JpR(@1#_UC_z2nQO>r14V$x zumgZALu&w8pl%V3D2xaCr2=l61DjZ@ugaEl49s4d!vxBe#vv)dgF!_g<{_m6QbaSD z;O>)Bayb)YwOdH7)vzL|a+Ty}5R0YNyx0d-( z>8{$Za^A0=Koxl92G}C=qyl|@oNr;;+9KJvTk-+%-#@_`zr7LJXn zDT;19#RQlJVxr1r6qH>717d0TT`g?SmliV$T5`Cc`i!*ng;Y~NK&OcZxe`p%6*Z@n zkw3W)O)*^45fD)Mn+L%oq|)8VXayFm)cMA<2kH|0K6(IR3h3>>v4^wsR?xu0pjBCN zC)XLMEC-{L4T0ic`4;%6&;2!RuB@DyPt(5sC|Cigt%AdFgMj0p*0!C+GzYL>dkUf2 z#%KfB_4#x35aY;k?fFxyQ4!oq@cGn%AbIOo1<0K4`0QSdxzZOukG8kr_F@Xzk2qp+K!N*%<)&YX*9Q2zJd-&8?D zg988h^9REt_j1#;bCC7~?z|{vK%Pgh0xTs`I>WLV$ablL7c>-c=sGHmoML3hqW0iq zX+9Z-l1tnUO7lE;sOl0Id>*9I)vyJ!k>17N(UAp-eU4Rw%~pV2;A}?e0delLBf}`C zO2<#;prnEr5S4Kq20(_e-(Euz3j$07bPyfsB1K+6S#6w*H(fcfC`~(23?!t2AOG~5 z-FQ^N+_nef;b~4le zCOx203VMKwI8Ncs7md=Mh$2~ggCq466r8Z2Yb1;A%oq_ITnL6Rsn?Gel%LZp-ooi^ zaVy^SVN~AxrL}Qd)M-5dQ(!U`e+8o3Cc?~)g3^&Hp#=N z@v=mz8c}v+SklJ5q&_e~rm3WnegtIw+t+>|QrkF69{=%Aq#+}9Rs?V^W9eWX-3bWi z6izhKFQ@^aW%ki=FMtvcb9vuXKD+4R31F%w3LMCiV&D)bG7O@_0xeR!qm(x?inuO7 z1?PS_;)K+M``o?zEJs$qggb%lzsNu z+zO&?RCrZF1UPnjLJ^1|2ArvjPq{q(?>~8>MY(1+%*C33}?Gxz@Q*ROp&l^(q2-?gZ{{})x- z?^upO{+B-=U2T8wVMq}P>=yXoL8do4@rY676v%0jpS*w~YKXZJNahsP5s)T}(@R!S zPATtP-Gz#?0t~pMeUl2IqQBUVqBc2+fn)*Q{WchvT8BxO8Y07Jq!@SF4ixbqx&T|2 zBEUPUNJ5TF7K^Sig<0-_@L?2-PsURA8P-Uc`b}q@p+Sx4QXeDiXfk_y+ z_gs_+obZH*QTBJAgfzQb`FE)_52HBL3>N$DW8gd>Tn(I7;Rx<>aLFKJ3>fz)qQOtv zBib3KR?se6+(B*t4l>QrD?>s1onYQ5(MHFng`cRQ3Clq(GD#@ zEhr9-9s|k%*#0$^rM%;l$%QXKXlS6wab_dua+mCqconA&~~d_U$;xtR3#@CPJ%`?Pj!U8@rnN z&4q2<%|*Tka)oP5b=aA=PlyG1UNT<%zpp_*xXaw#*4)(Bf2gb3w;vwm831n1qFyop z^n|*@W%tw0-8@I(0p#lCdz9E@(}TH0^4j3wOD>BOXJx-mFt(g`z6XxfmW0!Kk*6P& zVu3Vl;n>wEJRQ|L9CPkD^x9>aoW&D4cy8ZcB4>AB<4gw8|1$7KZ9kT*&`(7+6mL;Q zU|_>X@;0Ivi8;&cJp<$JR1lSHh>F;td9)XC^2`|3Nebu$ibBlqhFN zZrDG%Nd!rU;QRbkB*WnXsA%(eaNw>hwabVB#29+Vj{yAp4J{4a@2q>yGCjRf`0@0` zi@YV+JqfGqZ*^=mZQ3&)22BkO6E^Eq;K8E{fEP~y&H{DNlIdp{OWkH_Hte|yeL67u zqey@}k9uCBt>I+APCFg;4L#8@o3sZ92N?|KkvVxsX3tBy1Ro68X)n&$X1CimGdhiI z-RZDerW=ulT$7{obCZq@d?u}3dW}c+JA*XAUw3$3y1r9itZzg6sH;-+g`ir3=NEgr zM=2UkS_1a(d(GWynZ*@~dXMRw?9h`5#7kZ*MlELJ?@G4ufO=G1;Z5xLqN+(#4%0}5Bjx!`<^1GkDw-B;)_MIQ|i_$;=&vGvPDoUNJ175B9cFl3Z zEZQqyl`NnRNOAjhy7A@NW?e_?UCV{a7&`XKHMq76bcuoy@M82B2H1xn@;{Scqkl){ zQC^@}=QjQr!gr*<{wg{GhU9dQigPIML&LW^-=rnW9H{5|r7Y%zvS6OPi_k`4q=@E`8&CQxS|LZQm$Q zEN|Am_eb=;eWT<5eDKHM;*;S1p~ch0X8mj532b zxE^kvbh+pH=10|HZI}R))F(DrkpoCeNBn&5Pg5&qbZ@9mdIJv?Dp|&xPl9O%U@p?+6E22 z&uRDQ*Of!qg8t2(-tMb5@KX=Jq~cAUh3Km{&;!K2q*n1LbHK-n`KpBhb3i`N-uZti zM*Q$>v)O4e;BzY0E9HrQ3rj0=l~m#Nq{#r&M1MdNNc(y>`ih);+ zALs%6It!WI^W*3(Y0ymO|C4Fo8St&P?|0!}uK&$Wzy4qTtk=P}PJX_J>!GcFA>=zN zUP$Dj$Yz_))0uY}g5Mg!al&B@0o>uO9Tv gYks=QWEc38&)$wOTwNIqW%$EUc$?j=9c(cCA8JKBL;wH) literal 0 HcmV?d00001 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties b/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..94920145f34e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/gradlew b/samples/openapi3/client/petstore/java/jersey2-java8/gradlew new file mode 100644 index 000000000000..2fe81a7d95e4 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/gradlew.bat b/samples/openapi3/client/petstore/java/jersey2-java8/gradlew.bat new file mode 100644 index 000000000000..9618d8d9607c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/gradlew.bat @@ -0,0 +1,100 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml new file mode 100644 index 000000000000..9652f6687d4c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml @@ -0,0 +1,305 @@ + + 4.0.0 + org.openapitools + petstore-openapi3-jersey2-java8 + jar + petstore-openapi3-jersey2-java8 + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M4 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + org.tomitribe + tomitribe-http-signatures + ${http-signature-version} + + + com.github.scribejava + scribejava-apis + ${scribejava-apis-version} + + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.6.1 + 2.30.1 + 2.10.4 + 2.10.4 + 0.2.1 + 4.13 + 1.4 + 6.9.0 + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/settings.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/settings.gradle new file mode 100644 index 000000000000..e3652438a244 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "petstore-openapi3-jersey2-java8" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/AndroidManifest.xml b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..54fbcb3da1e8 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 000000000000..67bb225a52eb --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1287 @@ +package org.openapitools.client; + +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import com.github.scribejava.core.model.OAuth2AccessToken; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.HttpUrlConnectorProvider; +import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.MultiPart; +import org.glassfish.jersey.media.multipart.MultiPartFeature; + +import java.io.IOException; +import java.io.InputStream; + +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import org.glassfish.jersey.logging.LoggingFeature; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Map.Entry; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Date; + +import java.net.URLEncoder; + +import java.io.File; +import java.io.UnsupportedEncodingException; + +import java.text.DateFormat; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.HttpSignatureAuth; +import org.openapitools.client.auth.ApiKeyAuth; +import org.openapitools.client.auth.OAuth; +import org.openapitools.client.model.AbstractOpenApiSchema; + + +public class ApiClient { + protected Map defaultHeaderMap = new HashMap(); + protected Map defaultCookieMap = new HashMap(); + protected String basePath = "http://petstore.swagger.io:80/v2"; + private static final Logger log = Logger.getLogger(ApiClient.class.getName()); + + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "http://{server}.swagger.io:{port}/v2", + "petstore server", + new HashMap() {{ + put("server", new ServerVariable( + "No description provided", + "petstore", + new HashSet( + Arrays.asList( + "petstore", + "qa-petstore", + "dev-petstore" + ) + ) + )); + put("port", new ServerVariable( + "No description provided", + "80", + new HashSet( + Arrays.asList( + "80", + "8080" + ) + ) + )); + }} + ), + new ServerConfiguration( + "https://localhost:8080/{version}", + "The local server", + new HashMap() {{ + put("version", new ServerVariable( + "No description provided", + "v2", + new HashSet( + Arrays.asList( + "v1", + "v2" + ) + ) + )); + }} + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + protected Map> operationServers = new HashMap>() {{ + put("PetApi.addPet", new ArrayList(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new HashMap() + ), + + new ServerConfiguration( + "http://path-server-test.petstore.local/v2", + "No description provided", + new HashMap() + ) + ))); + put("PetApi.updatePet", new ArrayList(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new HashMap() + ), + + new ServerConfiguration( + "http://path-server-test.petstore.local/v2", + "No description provided", + new HashMap() + ) + ))); + }}; + protected Map operationServerIndex = new HashMap(); + protected Map> operationServerVariables = new HashMap>(); + protected boolean debugging = false; + protected int connectionTimeout = 0; + private int readTimeout = 0; + + protected Client httpClient; + protected JSON json; + protected String tempFolderPath = null; + + protected Map authentications; + protected Map authenticationLookup; + + protected DateFormat dateFormat; + + /** + * Constructs a new ApiClient with default parameters. + */ + public ApiClient() { + this(null); + } + + /** + * Constructs a new ApiClient with the specified authentication parameters. + * + * @param authMap A hash map containing authentication parameters. + */ + public ApiClient(Map authMap) { + json = new JSON(); + httpClient = buildHttpClient(debugging); + + this.dateFormat = new RFC3339DateFormat(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.0/java"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + Authentication auth = null; + if (authMap != null) { + auth = authMap.get("api_key"); + } + if (auth instanceof ApiKeyAuth) { + authentications.put("api_key", auth); + } else { + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + } + if (authMap != null) { + auth = authMap.get("api_key_query"); + } + if (auth instanceof ApiKeyAuth) { + authentications.put("api_key_query", auth); + } else { + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + } + if (authMap != null) { + auth = authMap.get("bearer_test"); + } + if (auth instanceof HttpBearerAuth) { + authentications.put("bearer_test", auth); + } else { + authentications.put("bearer_test", new HttpBearerAuth("bearer")); + } + if (authMap != null) { + auth = authMap.get("http_basic_test"); + } + if (auth instanceof HttpBasicAuth) { + authentications.put("http_basic_test", auth); + } else { + authentications.put("http_basic_test", new HttpBasicAuth()); + } + if (authMap != null) { + auth = authMap.get("http_signature_test"); + } + if (auth instanceof HttpSignatureAuth) { + authentications.put("http_signature_test", auth); + } + if (authMap != null) { + auth = authMap.get("petstore_auth"); + } + if (auth instanceof OAuth) { + authentications.put("petstore_auth", auth); + } else { + authentications.put("petstore_auth", new OAuth(basePath, "")); + } + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + + // Setup authentication lookup (key: authentication alias, value: authentication name) + authenticationLookup = new HashMap(); + } + + /** + * Gets the JSON instance to do JSON serialization and deserialization. + * + * @return JSON + */ + public JSON getJSON() { + return json; + } + + public Client getHttpClient() { + return httpClient; + } + + public ApiClient setHttpClient(Client httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Returns the base URL to the location where the OpenAPI document is being served. + * + * @return The base URL to the target host. + */ + public String getBasePath() { + return basePath; + } + + /** + * Sets the base URL to the location where the OpenAPI document is being served. + * + * @param basePath The base URL to the target host. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + setOauthBasePath(basePath); + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + updateBasePath(); + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + updateBasePath(); + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + updateBasePath(); + return this; + } + + private void updateBasePath() { + if (serverIndex != null) { + setBasePath(servers.get(serverIndex).URL(serverVariables)); + } + } + + private void setOauthBasePath(String basePath) { + for(Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setBasePath(basePath); + } + } + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication object + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public ApiClient setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return this; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public ApiClient setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return this; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public ApiClient setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + */ + public ApiClient configureApiKeys(HashMap secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.containsKey(name) ? authenticationLookup.get(name) : name; + if (secrets.containsKey(name)) { + ((ApiKeyAuth) auth).setApiKey(secrets.get(name)); + } + } + } + return this; + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public ApiClient setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set bearer token for the first Bearer authentication. + * + * @param bearerToken Bearer token + */ + public ApiClient setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return this; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken Access token + */ + public ApiClient setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the credentials for the first OAuth2 authentication. + * + * @param clientId the client ID + * @param clientSecret the client secret + */ + public ApiClient setOauthCredentials(String clientId, String clientSecret) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentials(clientId, clientSecret); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the password flow for the first OAuth2 authentication. + * + * @param username the user name + * @param password the user password + */ + public ApiClient setOauthPasswordFlow(String username, String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).usePasswordFlow(username, password); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the authorization code flow for the first OAuth2 authentication. + * + * @param code the authorization code + */ + public ApiClient setOauthAuthorizationCodeFlow(String code) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).useAuthorizationCodeFlow(code); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the scopes for the first OAuth2 authentication. + * + * @param scope the oauth scope + */ + public ApiClient setOauthScope(String scope) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setScope(scope); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent Http user agent + * @return API client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return API client + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return API client + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * @return True if debugging is switched on + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return API client + */ + public ApiClient setDebugging(boolean debugging) { + this.debugging = debugging; + // Rebuild HTTP Client according to the new "debugging" value. + this.httpClient = buildHttpClient(debugging); + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default tempopary folder. + * + * @return Temp folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set temp folder path + * @param tempFolderPath Temp folder path + * @return API client + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Connect timeout (in milliseconds). + * @return Connection timeout + */ + public int getConnectTimeout() { + return connectionTimeout; + } + + /** + * Set the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * @param connectionTimeout Connection timeout in milliseconds + * @return API client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); + return this; + } + + /** + * read timeout (in milliseconds). + * @return Read timeout + */ + public int getReadTimeout() { + return readTimeout; + } + + /** + * Set the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * @param readTimeout Read timeout in milliseconds + * @return API client + */ + public ApiClient setReadTimeout(int readTimeout) { + this.readTimeout = readTimeout; + httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return Date format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * @param dateFormat Date format + * @return API client + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + // also set the date format for model (de)serialization with Date properties + this.json.setDateFormat((DateFormat) dateFormat.clone()); + return this; + } + + /** + * Parse the given string into Date object. + * @param str String + * @return Date + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + * @param date Date + * @return Date in string format + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * @param param Object + * @return Object in string format + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(','); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /* + * Format to {@code Pair} objects. + * @param collectionFormat Collection format + * @param name Name + * @param value Value + * @return List of pairs + */ + public List parameterToPairs(String collectionFormat, String name, Object value){ + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + // get the collection format (default: csv) + String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); + + // create the params based on the collection format + if ("multi".equals(format)) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } + + return params; + } + + String delimiter = ","; + + if ("csv".equals(format)) { + delimiter = ","; + } else if ("ssv".equals(format)) { + delimiter = " "; + } else if ("tsv".equals(format)) { + delimiter = "\t"; + } else if ("pipes".equals(format)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME + * @return True if the MIME type is JSON + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * @param str String + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Serialize the given Java object into string entity according the given + * Content-Type (only JSON is supported for now). + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @return Entity + * @throws ApiException API exception + */ + public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { + Entity entity; + if (contentType.startsWith("multipart/form-data")) { + MultiPart multiPart = new MultiPart(); + for (Entry param: formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) + .fileName(file.getName()).size(file.length()).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); + } else { + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); + } + } + entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + Form form = new Form(); + for (Entry param: formParams.entrySet()) { + form.param(param.getKey(), parameterToString(param.getValue())); + } + entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); + } else { + // We let jersey handle the serialization + entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType); + } + return entity; + } + + /** + * Serialize the given Java object into string according the given + * Content-Type (only JSON, HTTP form is supported for now). + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @return String + * @throws ApiException API exception + */ + public String serializeToString(Object obj, Map formParams, String contentType) throws ApiException { + try { + if (contentType.startsWith("multipart/form-data")) { + throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)"); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + String formString = ""; + for (Entry param : formParams.entrySet()) { + formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&"; + } + + if (formString.length() == 0) { // empty string + return formString; + } else { + return formString.substring(0, formString.length() - 1); + } + } else { + return json.getMapper().writeValueAsString(obj); + } + } catch (Exception ex) { + throw new ApiException("Failed to perform serializeToString: " + ex.toString()); + } + } + + public AbstractOpenApiSchema deserializeSchemas(Response response, AbstractOpenApiSchema schema) throws ApiException{ + + Object result = null; + int matchCounter = 0; + ArrayList matchSchemas = new ArrayList<>(); + + if (schema.isNullable()) { + response.bufferEntity(); + if ("{}".equals(String.valueOf(response.readEntity(String.class))) || + "".equals(String.valueOf(response.readEntity(String.class)))) { + // schema is nullable and the response body is {} or empty string + return schema; + } + } + + for (Map.Entry entry : schema.getSchemas().entrySet()) { + String schemaName = entry.getKey(); + GenericType schemaType = entry.getValue(); + + if (schemaType instanceof GenericType) { // model + try { + Object deserializedObject = deserialize(response, schemaType); + if (deserializedObject != null) { + result = deserializedObject; + matchCounter++; + + if ("anyOf".equals(schema.getSchemaType())) { + break; + } else if ("oneOf".equals(schema.getSchemaType())) { + matchSchemas.add(schemaName); + } else { + throw new ApiException("Unknowe type found while expecting anyOf/oneOf:" + schema.getSchemaType()); + } + } else { + // failed to deserialize the response in the schema provided, proceed to the next one if any + } + } catch (Exception ex) { + // failed to deserialize, do nothing and try next one (schema) + // Logging the error may be useful to troubleshoot why a payload fails to match + // the schema. + log.log(Level.FINE, "Input data does not match schema '" + schemaName + "'", ex); + } + } else {// unknown type + throw new ApiException(schemaType.getClass() + " is not a GenericType and cannot be handled properly in deserialization."); + } + + } + + if (matchCounter > 1 && "oneOf".equals(schema.getSchemaType())) {// more than 1 match for oneOf + throw new ApiException("Response body is invalid as it matches more than one schema (" + StringUtil.join(matchSchemas, ", ") + ") defined in the oneOf model: " + schema.getClass().getName()); + } else if (matchCounter == 0) { // fail to match any in oneOf/anyOf schemas + throw new ApiException("Response body is invalid as it does not match any schemas (" + StringUtil.join(schema.getSchemas().keySet(), ", ") + ") defined in the oneOf/anyOf model: " + schema.getClass().getName()); + } else { // only one matched + schema.setActualInstance(result); + return schema; + } + + } + + + + /** + * Deserialize response body to Java object according to the Content-Type. + * @param Type + * @param response Response + * @param returnType Return type + * @return Deserialize object + * @throws ApiException API exception + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, GenericType returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + return (T) response.readEntity(byte[].class); + } else if (returnType.getRawType() == File.class) { + // Handle file downloading. + T file = (T) downloadFileFromResponse(response); + return file; + } + + String contentType = null; + List contentTypes = response.getHeaders().get("Content-Type"); + if (contentTypes != null && !contentTypes.isEmpty()) + contentType = String.valueOf(contentTypes.get(0)); + + // read the entity stream multiple times + response.bufferEntity(); + + return response.readEntity(returnType); + } + + /** + * Download file from the given response. + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) + filename = matcher.group(1); + } + + String prefix; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf('.'); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // File.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return File.createTempFile(prefix, suffix); + else + return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param Type + * @param operation The qualified name of the operation + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @param schema An instance of the response that uses oneOf/anyOf + * @return The response body in type of string + * @throws ApiException API exception + */ + public ApiResponse invokeAPI( + String operation, + String path, + String method, + List queryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String accept, + String contentType, + String[] authNames, + GenericType returnType, + AbstractOpenApiSchema schema) + throws ApiException { + + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" + String targetURL; + if (serverIndex != null && operationServers.containsKey(operation)) { + Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex; + Map variables = operationServerVariables.containsKey(operation) ? + operationServerVariables.get(operation) : serverVariables; + List serverConfigurations = operationServers.get(operation); + if (index < 0 || index >= serverConfigurations.size()) { + throw new ArrayIndexOutOfBoundsException( + String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", + index, serverConfigurations.size())); + } + targetURL = serverConfigurations.get(index).URL(variables) + path; + } else { + targetURL = this.basePath + path; + } + WebTarget target = httpClient.target(targetURL); + + if (queryParams != null) { + for (Pair queryParam : queryParams) { + if (queryParam.getValue() != null) { + target = target.queryParam(queryParam.getName(), escapeString(queryParam.getValue())); + } + } + } + + Invocation.Builder invocationBuilder = target.request().accept(accept); + + for (Entry entry : cookieParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + Entity entity = serialize(body, formParams, contentType); + + // put all headers in one place + Map allHeaderParams = new HashMap<>(defaultHeaderMap); + allHeaderParams.putAll(headerParams); + + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + serializeToString(body, formParams, contentType), + method, + target.getUri()); + + for (Entry entry : allHeaderParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.header(entry.getKey(), value); + } + } + + Response response = null; + + try { + response = sendRequest(method, invocationBuilder, entity); + + // If OAuth is used and a status 401 is received, renew the access token and retry the request + if (response.getStatusInfo() == Status.UNAUTHORIZED) { + for (String authName : authNames) { + Authentication authentication = authentications.get(authName); + if (authentication instanceof OAuth) { + OAuth2AccessToken accessToken = ((OAuth) authentication).renewAccessToken(); + if (accessToken != null) { + invocationBuilder.header("Authorization", null); + invocationBuilder.header("Authorization", "Bearer " + accessToken.getAccessToken()); + response = sendRequest(method, invocationBuilder, entity); + } + break; + } + } + } + + int statusCode = response.getStatusInfo().getStatusCode(); + Map> responseHeaders = buildResponseHeaders(response); + + if (response.getStatusInfo() == Status.NO_CONTENT) { + return new ApiResponse(statusCode, responseHeaders); + } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { + if (returnType == null) return new ApiResponse(statusCode, responseHeaders); + else if (schema == null) { + return new ApiResponse(statusCode, responseHeaders, deserialize(response, returnType)); + } else { // oneOf/anyOf + return new ApiResponse( + statusCode, responseHeaders, (T) deserializeSchemas(response, schema)); + } + } else { + String message = "error"; + String respBody = null; + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), message, buildResponseHeaders(response), respBody); + } + } finally { + try { + response.close(); + } catch (Exception e) { + // it's not critical, since the response object is local in method invokeAPI; that's fine, + // just continue + } + } + } + + private Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { + Response response; + if ("POST".equals(method)) { + response = invocationBuilder.post(entity); + } else if ("PUT".equals(method)) { + response = invocationBuilder.put(entity); + } else if ("DELETE".equals(method)) { + response = invocationBuilder.method("DELETE", entity); + } else if ("PATCH".equals(method)) { + response = invocationBuilder.method("PATCH", entity); + } else { + response = invocationBuilder.method(method); + } + return response; + } + + /** + * @deprecated Add qualified name of the operation as a first parameter. + */ + @Deprecated + public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, AbstractOpenApiSchema schema) throws ApiException { + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, schema); + } + + /** + * Build the Client used to make HTTP requests. + * @param debugging Debug setting + * @return Client + */ + protected Client buildHttpClient(boolean debugging) { + final ClientConfig clientConfig = new ClientConfig(); + clientConfig.register(MultiPartFeature.class); + clientConfig.register(json); + clientConfig.register(JacksonFeature.class); + clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); + if (debugging) { + clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); + clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); + // Set logger to ALL + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); + } + performAdditionalClientConfiguration(clientConfig); + return ClientBuilder.newClient(clientConfig); + } + + protected void performAdditionalClientConfiguration(ClientConfig clientConfig) { + // No-op extension point + } + + protected Map> buildResponseHeaders(Response response) { + Map> responseHeaders = new HashMap>(); + for (Entry> entry: response.getHeaders().entrySet()) { + List values = entry.getValue(); + List headers = new ArrayList(); + for (Object o : values) { + headers.add(String.valueOf(o)); + } + responseHeaders.put(entry.getKey(), headers); + } + return responseHeaders; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param method HTTP method (e.g. POST) + * @param uri HTTP URI + */ + protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + continue; + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiException.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 000000000000..3612265bc619 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client; + +import java.util.Map; +import java.util.List; + +/** + * API Exception + */ + +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 000000000000..5f3daf26600c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + private final int statusCode; + private final Map> headers; + private final T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + * Get the status code + * + * @return status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + * Get the headers + * + * @return map of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + * Get the data + * + * @return data + */ + public T getData() { + return data; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/Configuration.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 000000000000..acbecda489dd --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client; + + +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 000000000000..fd834ef6b4a0 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,49 @@ +package org.openapitools.client; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + +import java.text.DateFormat; + +import javax.ws.rs.ext.ContextResolver; + + +public class JSON implements ContextResolver { + private ObjectMapper mapper; + + public JSON() { + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.setDateFormat(new RFC3339DateFormat()); + mapper.registerModule(new JavaTimeModule()); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/Pair.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 000000000000..ae89aa614543 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client; + + +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + if (arg.trim().isEmpty()) { + return false; + } + + return true; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 000000000000..9509fd089812 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.ISO8601DateFormat; +import com.fasterxml.jackson.databind.util.ISO8601Utils; + +import java.text.FieldPosition; +import java.util.Date; + + +public class RFC3339DateFormat extends ISO8601DateFormat { + + // Same as ISO8601DateFormat but serializing milliseconds. + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + String value = ISO8601Utils.format(date, true); + toAppendTo.append(value); + return toAppendTo; + } + +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 000000000000..a1107a8690e4 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A describtion of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replaceAll("\\{" + name + "\\}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerVariable.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 000000000000..c2f13e216662 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/StringUtil.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 000000000000..747a23f5bf23 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + + +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 000000000000..4d808ec6f5f1 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,115 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import org.openapitools.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model (required) + * @return Client + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public Client call123testSpecialTags(Client client) throws ApiException { + return call123testSpecialTagsWithHttpInfo(client).getData(); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); + } + + // create path and map variables + String localVarPath = "/another-fake/dummy"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 000000000000..eb269e49f800 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,108 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import org.openapitools.client.model.InlineResponseDefault; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class DefaultApi { + private ApiClient apiClient; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * + * @return InlineResponseDefault + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
0 response -
+ */ + public InlineResponseDefault fooGet() throws ApiException { + return fooGetWithHttpInfo().getData(); + } + + /** + * + * + * @return ApiResponse<InlineResponseDefault> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
0 response -
+ */ + public ApiResponse fooGetWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/foo"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("DefaultApi.fooGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 000000000000..c57ccaa41570 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,1196 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.User; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class FakeApi { + private ApiClient apiClient; + + public FakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public FakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Health check endpoint + * + * @return HealthCheckResult + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 The instance started successfully -
+ */ + public HealthCheckResult fakeHealthGet() throws ApiException { + return fakeHealthGetWithHttpInfo().getData(); + } + + /** + * Health check endpoint + * + * @return ApiResponse<HealthCheckResult> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 The instance started successfully -
+ */ + public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/health"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.fakeHealthGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Output boolean -
+ */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + return fakeOuterBooleanSerializeWithHttpInfo(body).getData(); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Output boolean -
+ */ + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/boolean"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Output composite -
+ */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { + return fakeOuterCompositeSerializeWithHttpInfo(outerComposite).getData(); + } + + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @return ApiResponse<OuterComposite> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Output composite -
+ */ + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { + Object localVarPostBody = outerComposite; + + // create path and map variables + String localVarPath = "/fake/outer/composite"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Output number -
+ */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + return fakeOuterNumberSerializeWithHttpInfo(body).getData(); + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return ApiResponse<BigDecimal> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Output number -
+ */ + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/number"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Output string -
+ */ + public String fakeOuterStringSerialize(String body) throws ApiException { + return fakeOuterStringSerializeWithHttpInfo(body).getData(); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Output string -
+ */ + public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/string"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException { + testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException { + Object localVarPostBody = fileSchemaTestClass; + + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) { + throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema"); + } + + // create path and map variables + String localVarPath = "/fake/body-with-file-schema"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public void testBodyWithQueryParams(String query, User user) throws ApiException { + testBodyWithQueryParamsWithHttpInfo(query, user); + } + + /** + * + * + * @param query (required) + * @param user (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + + // create path and map variables + String localVarPath = "/fake/body-with-query-params"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @return Client + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public Client testClientModel(Client client) throws ApiException { + return testClientModelWithHttpInfo(client).getData(); + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClientModel"); + } + + // create path and map variables + String localVarPath = "/fake"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.testClientModel", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
400 Invalid username supplied -
404 User not found -
+ */ + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
400 Invalid username supplied -
404 User not found -
+ */ + public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'number' is set + if (number == null) { + throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); + } + + // verify the required parameter '_double' is set + if (_double == null) { + throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); + } + + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) { + throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); + } + + // verify the required parameter '_byte' is set + if (_byte == null) { + throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); + } + + // create path and map variables + String localVarPath = "/fake"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + if (integer != null) + localVarFormParams.put("integer", integer); +if (int32 != null) + localVarFormParams.put("int32", int32); +if (int64 != null) + localVarFormParams.put("int64", int64); +if (number != null) + localVarFormParams.put("number", number); +if (_float != null) + localVarFormParams.put("float", _float); +if (_double != null) + localVarFormParams.put("double", _double); +if (string != null) + localVarFormParams.put("string", string); +if (patternWithoutDelimiter != null) + localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); +if (_byte != null) + localVarFormParams.put("byte", _byte); +if (binary != null) + localVarFormParams.put("binary", binary); +if (date != null) + localVarFormParams.put("date", date); +if (dateTime != null) + localVarFormParams.put("dateTime", dateTime); +if (password != null) + localVarFormParams.put("password", password); +if (paramCallback != null) + localVarFormParams.put("callback", paramCallback); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_basic_test" }; + + return apiClient.invokeAPI("FakeApi.testEndpointParameters", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
400 Invalid request -
404 Not found -
+ */ + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
400 Invalid request -
404 Not found -
+ */ + public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); + + if (enumHeaderStringArray != null) + localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); +if (enumHeaderString != null) + localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + + + if (enumFormStringArray != null) + localVarFormParams.put("enum_form_string_array", enumFormStringArray); +if (enumFormString != null) + localVarFormParams.put("enum_form_string", enumFormString); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testEnumParameters", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + +private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); + } + + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); + } + + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); + } + + // create path and map variables + String localVarPath = "/fake"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_string_group", requiredStringGroup)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_int64_group", requiredInt64Group)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "string_group", stringGroup)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "int64_group", int64Group)); + + if (requiredBooleanGroup != null) + localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); +if (booleanGroup != null) + localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "bearer_test" }; + + return apiClient.invokeAPI("FakeApi.testGroupParameters", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + + public class APItestGroupParametersRequest { + private Integer requiredStringGroup; + private Boolean requiredBooleanGroup; + private Long requiredInt64Group; + private Integer stringGroup; + private Boolean booleanGroup; + private Long int64Group; + + private APItestGroupParametersRequest() { + } + + /** + * Set requiredStringGroup + * @param requiredStringGroup Required String in group parameters (required) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest requiredStringGroup(Integer requiredStringGroup) { + this.requiredStringGroup = requiredStringGroup; + return this; + } + + /** + * Set requiredBooleanGroup + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest requiredBooleanGroup(Boolean requiredBooleanGroup) { + this.requiredBooleanGroup = requiredBooleanGroup; + return this; + } + + /** + * Set requiredInt64Group + * @param requiredInt64Group Required Integer in group parameters (required) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest requiredInt64Group(Long requiredInt64Group) { + this.requiredInt64Group = requiredInt64Group; + return this; + } + + /** + * Set stringGroup + * @param stringGroup String in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest stringGroup(Integer stringGroup) { + this.stringGroup = stringGroup; + return this; + } + + /** + * Set booleanGroup + * @param booleanGroup Boolean in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest booleanGroup(Boolean booleanGroup) { + this.booleanGroup = booleanGroup; + return this; + } + + /** + * Set int64Group + * @param int64Group Integer in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest int64Group(Long int64Group) { + this.int64Group = int64Group; + return this; + } + + /** + * Execute testGroupParameters request + + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
400 Someting wrong -
+ + */ + + public void execute() throws ApiException { + this.executeWithHttpInfo().getData(); + } + + /** + * Execute testGroupParameters request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
400 Someting wrong -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @return testGroupParametersRequest + * @throws ApiException if fails to make API call + + + */ + public APItestGroupParametersRequest testGroupParameters() throws ApiException { + return new APItestGroupParametersRequest(); + } + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public void testInlineAdditionalProperties(Map requestBody) throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(requestBody); + } + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map requestBody) throws ApiException { + Object localVarPostBody = requestBody; + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); + } + + // create path and map variables + String localVarPath = "/fake/inline-additionalProperties"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public void testJsonFormData(String param, String param2) throws ApiException { + testJsonFormDataWithHttpInfo(param, param2); + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'param' is set + if (param == null) { + throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); + } + + // verify the required parameter 'param2' is set + if (param2 == null) { + throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); + } + + // create path and map variables + String localVarPath = "/fake/jsonFormData"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + if (param != null) + localVarFormParams.put("param", param); +if (param2 != null) + localVarFormParams.put("param2", param2); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testJsonFormData", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testQueryParameterCollectionFormat", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 000000000000..339851556a57 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,115 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import org.openapitools.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class FakeClassnameTags123Api { + private ApiClient apiClient; + + public FakeClassnameTags123Api() { + this(Configuration.getDefaultApiClient()); + } + + public FakeClassnameTags123Api(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model (required) + * @return Client + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public Client testClassname(Client client) throws ApiException { + return testClassnameWithHttpInfo(client).getData(); + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname"); + } + + // create path and map variables + String localVarPath = "/fake_classname_test"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key_query" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 000000000000..d1bd8c6a5104 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,697 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class PetApi { + private ApiClient apiClient; + + public PetApi() { + this(Configuration.getDefaultApiClient()); + } + + public PetApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
405 Invalid input -
+ */ + public void addPet(Pet pet) throws ApiException { + addPetWithHttpInfo(pet); + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
405 Invalid input -
+ */ + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + Object localVarPostBody = pet; + + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); + } + + // create path and map variables + String localVarPath = "/pet"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; + + return apiClient.invokeAPI("PetApi.addPet", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
400 Invalid pet value -
+ */ + public void deletePet(Long petId, String apiKey) throws ApiException { + deletePetWithHttpInfo(petId, apiKey); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
400 Invalid pet value -
+ */ + public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); + } + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + if (apiKey != null) + localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return List<Pet> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid status value -
+ */ + public List findPetsByStatus(List status) throws ApiException { + return findPetsByStatusWithHttpInfo(status).getData(); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid status value -
+ */ + public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'status' is set + if (status == null) { + throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); + } + + // create path and map variables + String localVarPath = "/pet/findByStatus"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; + + GenericType> localVarReturnType = new GenericType>() {}; + + return apiClient.invokeAPI("PetApi.findPetsByStatus", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return List<Pet> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid tag value -
+ * @deprecated + */ + @Deprecated + public List findPetsByTags(List tags) throws ApiException { + return findPetsByTagsWithHttpInfo(tags).getData(); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid tag value -
+ * @deprecated + */ + @Deprecated + public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'tags' is set + if (tags == null) { + throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); + } + + // create path and map variables + String localVarPath = "/pet/findByTags"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; + + GenericType> localVarReturnType = new GenericType>() {}; + + return apiClient.invokeAPI("PetApi.findPetsByTags", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return Pet + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid ID supplied -
404 Pet not found -
+ */ + public Pet getPetById(Long petId) throws ApiException { + return getPetByIdWithHttpInfo(petId).getData(); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return ApiResponse<Pet> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid ID supplied -
404 Pet not found -
+ */ + public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); + } + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
400 Invalid ID supplied -
404 Pet not found -
405 Validation exception -
+ */ + public void updatePet(Pet pet) throws ApiException { + updatePetWithHttpInfo(pet); + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
400 Invalid ID supplied -
404 Pet not found -
405 Validation exception -
+ */ + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + Object localVarPostBody = pet; + + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); + } + + // create path and map variables + String localVarPath = "/pet"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; + + return apiClient.invokeAPI("PetApi.updatePet", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
405 Invalid input -
+ */ + public void updatePetWithForm(Long petId, String name, String status) throws ApiException { + updatePetWithFormWithHttpInfo(petId, name, status); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
405 Invalid input -
+ */ + public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); + } + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + if (name != null) + localVarFormParams.put("name", name); +if (status != null) + localVarFormParams.put("status", status); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ModelApiResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { + return uploadFileWithHttpInfo(petId, additionalMetadata, file).getData(); + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); + } + + // create path and map variables + String localVarPath = "/pet/{petId}/uploadImage" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + if (additionalMetadata != null) + localVarFormParams.put("additionalMetadata", additionalMetadata); +if (file != null) + localVarFormParams.put("file", file); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ModelApiResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata).getData(); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); + } + + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); + } + + // create path and map variables + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + if (additionalMetadata != null) + localVarFormParams.put("additionalMetadata", additionalMetadata); +if (requiredFile != null) + localVarFormParams.put("requiredFile", requiredFile); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 000000000000..0e29deb7564f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,316 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import org.openapitools.client.model.Order; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class StoreApi { + private ApiClient apiClient; + + public StoreApi() { + this(Configuration.getDefaultApiClient()); + } + + public StoreApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
400 Invalid ID supplied -
404 Order not found -
+ */ + public void deleteOrder(String orderId) throws ApiException { + deleteOrderWithHttpInfo(orderId); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
400 Invalid ID supplied -
404 Order not found -
+ */ + public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); + } + + // create path and map variables + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Map<String, Integer> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public Map getInventory() throws ApiException { + return getInventoryWithHttpInfo().getData(); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiResponse<Map<String, Integer>> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse> getInventoryWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/store/inventory"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key" }; + + GenericType> localVarReturnType = new GenericType>() {}; + + return apiClient.invokeAPI("StoreApi.getInventory", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Order + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid ID supplied -
404 Order not found -
+ */ + public Order getOrderById(Long orderId) throws ApiException { + return getOrderByIdWithHttpInfo(orderId).getData(); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return ApiResponse<Order> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid ID supplied -
404 Order not found -
+ */ + public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); + } + + // create path and map variables + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return Order + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid Order -
+ */ + public Order placeOrder(Order order) throws ApiException { + return placeOrderWithHttpInfo(order).getData(); + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return ApiResponse<Order> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid Order -
+ */ + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + Object localVarPostBody = order; + + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); + } + + // create path and map variables + String localVarPath = "/store/order"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("StoreApi.placeOrder", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 000000000000..9b6250da568d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,588 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import org.openapitools.client.model.User; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class UserApi { + private ApiClient apiClient; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
0 successful operation -
+ */ + public void createUser(User user) throws ApiException { + createUserWithHttpInfo(user); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
0 successful operation -
+ */ + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); + } + + // create path and map variables + String localVarPath = "/user"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.createUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
0 successful operation -
+ */ + public void createUsersWithArrayInput(List user) throws ApiException { + createUsersWithArrayInputWithHttpInfo(user); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
0 successful operation -
+ */ + public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); + } + + // create path and map variables + String localVarPath = "/user/createWithArray"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
0 successful operation -
+ */ + public void createUsersWithListInput(List user) throws ApiException { + createUsersWithListInputWithHttpInfo(user); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
0 successful operation -
+ */ + public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); + } + + // create path and map variables + String localVarPath = "/user/createWithList"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.createUsersWithListInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
400 Invalid username supplied -
404 User not found -
+ */ + public void deleteUser(String username) throws ApiException { + deleteUserWithHttpInfo(username); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
400 Invalid username supplied -
404 User not found -
+ */ + public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); + } + + // create path and map variables + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return User + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid username supplied -
404 User not found -
+ */ + public User getUserByName(String username) throws ApiException { + return getUserByNameWithHttpInfo(username).getData(); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return ApiResponse<User> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 successful operation -
400 Invalid username supplied -
404 User not found -
+ */ + public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); + } + + // create path and map variables + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return String + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
400 Invalid username/password supplied -
+ */ + public String loginUser(String username, String password) throws ApiException { + return loginUserWithHttpInfo(username, password).getData(); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
400 Invalid username/password supplied -
+ */ + public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); + } + + // verify the required parameter 'password' is set + if (password == null) { + throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); + } + + // create path and map variables + String localVarPath = "/user/login"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("UserApi.loginUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Logs out current logged in user session + * + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
0 successful operation -
+ */ + public void logoutUser() throws ApiException { + logoutUserWithHttpInfo(); + } + + /** + * Logs out current logged in user session + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
0 successful operation -
+ */ + public ApiResponse logoutUserWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user/logout"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.logoutUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
400 Invalid user supplied -
404 User not found -
+ */ + public void updateUser(String username, User user) throws ApiException { + updateUserWithHttpInfo(username, user); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
400 Invalid user supplied -
404 User not found -
+ */ + public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); + } + + // create path and map variables + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 000000000000..c1b2e4840702 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + + +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 000000000000..579b5e0d6d53 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 000000000000..e6f95e585639 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.util.Base64; +import java.nio.charset.StandardCharsets; + +import java.net.URI; +import java.util.Map; +import java.util.List; + + + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 000000000000..1b46b4c6839f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + + +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if(bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java new file mode 100644 index 000000000000..5f0e4dba3509 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java @@ -0,0 +1,265 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.net.URLEncoder; +import java.security.MessageDigest; +import java.security.Key; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.List; +import java.security.spec.AlgorithmParameterSpec; +import java.security.InvalidKeyException; + +import org.tomitribe.auth.signatures.Algorithm; +import org.tomitribe.auth.signatures.Signer; +import org.tomitribe.auth.signatures.Signature; +import org.tomitribe.auth.signatures.SigningAlgorithm; + +/** + * A Configuration object for the HTTP message signature security scheme. + */ +public class HttpSignatureAuth implements Authentication { + + private Signer signer; + + // An opaque string that the server can use to look up the component they need to validate the signature. + private String keyId; + + // The HTTP signature algorithm. + private SigningAlgorithm signingAlgorithm; + + // The HTTP cryptographic algorithm. + private Algorithm algorithm; + + // The cryptographic parameters. + private AlgorithmParameterSpec parameterSpec; + + // The list of HTTP headers that should be included in the HTTP signature. + private List headers; + + // The digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. + private String digestAlgorithm; + + /** + * Construct a new HTTP signature auth configuration object. + * + * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. + * @param signingAlgorithm The signature algorithm. + * @param algorithm The cryptographic algorithm. + * @param digestAlgorithm The digest algorithm. + * @param headers The list of HTTP headers that should be included in the HTTP signature. + */ + public HttpSignatureAuth(String keyId, + SigningAlgorithm signingAlgorithm, + Algorithm algorithm, + String digestAlgorithm, + AlgorithmParameterSpec parameterSpec, + List headers) { + this.keyId = keyId; + this.signingAlgorithm = signingAlgorithm; + this.algorithm = algorithm; + this.parameterSpec = parameterSpec; + this.digestAlgorithm = digestAlgorithm; + this.headers = headers; + } + + /** + * Returns the opaque string that the server can use to look up the component they need to validate the signature. + * + * @return The keyId. + */ + public String getKeyId() { + return keyId; + } + + /** + * Set the HTTP signature key id. + * + * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. + */ + public void setKeyId(String keyId) { + this.keyId = keyId; + } + + /** + * Returns the HTTP signature algorithm which is used to sign HTTP requests. + */ + public SigningAlgorithm getSigningAlgorithm() { + return signingAlgorithm; + } + + /** + * Sets the HTTP signature algorithm which is used to sign HTTP requests. + * + * @param signingAlgorithm The HTTP signature algorithm. + */ + public void setSigningAlgorithm(SigningAlgorithm signingAlgorithm) { + this.signingAlgorithm = signingAlgorithm; + } + + /** + * Returns the HTTP cryptographic algorithm which is used to sign HTTP requests. + */ + public Algorithm getAlgorithm() { + return algorithm; + } + + /** + * Sets the HTTP cryptographic algorithm which is used to sign HTTP requests. + * + * @param algorithm The HTTP signature algorithm. + */ + public void setAlgorithm(Algorithm algorithm) { + this.algorithm = algorithm; + } + + /** + * Returns the cryptographic parameters which are used to sign HTTP requests. + */ + public AlgorithmParameterSpec getAlgorithmParameterSpec() { + return parameterSpec; + } + + /** + * Sets the cryptographic parameters which are used to sign HTTP requests. + * + * @param parameterSpec The cryptographic parameters. + */ + public void setAlgorithmParameterSpec(AlgorithmParameterSpec parameterSpec) { + this.parameterSpec = parameterSpec; + } + + /** + * Returns the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. + * + * @see java.security.MessageDigest + */ + public String getDigestAlgorithm() { + return digestAlgorithm; + } + + /** + * Sets the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. + * + * The exact list of supported digest algorithms depends on the installed security providers. + * Every implementation of the Java platform is required to support "MD5", "SHA-1" and "SHA-256". + * Do not use "MD5" and "SHA-1", they are vulnerable to multiple known attacks. + * By default, "SHA-256" is used. + * + * @param digestAlgorithm The digest algorithm. + * + * @see java.security.MessageDigest + */ + public void setDigestAlgorithm(String digestAlgorithm) { + this.digestAlgorithm = digestAlgorithm; + } + + /** + * Returns the list of HTTP headers that should be included in the HTTP signature. + */ + public List getHeaders() { + return headers; + } + + /** + * Sets the list of HTTP headers that should be included in the HTTP signature. + * + * @param headers The HTTP headers. + */ + public void setHeaders(List headers) { + this.headers = headers; + } + + /** + * Returns the signer instance used to sign HTTP messages. + * + * @return the signer instance. + */ + public Signer getSigner() { + return signer; + } + + /** + * Sets the signer instance used to sign HTTP messages. + * + * @param signer The signer instance to set. + */ + public void setSigner(Signer signer) { + this.signer = signer; + } + + /** + * Set the private key used to sign HTTP requests using the HTTP signature scheme. + * + * @param key The private key. + * + * @throws InvalidKeyException Unable to parse the key, or the security provider for this key + * is not installed. + */ + public void setPrivateKey(Key key) throws InvalidKeyException, ApiException { + if (key == null) { + throw new ApiException("Private key (java.security.Key) cannot be null"); + } + signer = new Signer(key, new Signature(keyId, signingAlgorithm, algorithm, parameterSpec, null, headers)); + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + try { + if (headers.contains("host")) { + headerParams.put("host", uri.getHost()); + } + + if (headers.contains("date")) { + headerParams.put("date", new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US).format(new Date())); + } + + if (headers.contains("digest")) { + headerParams.put("digest", + this.digestAlgorithm + "=" + + new String(Base64.getEncoder().encode(MessageDigest.getInstance(this.digestAlgorithm).digest(payload.getBytes())))); + } + + if (signer == null) { + throw new ApiException("Signer cannot be null. Please call the method `setPrivateKey` to set it up correctly"); + } + + // construct the path with the URL query string + String path = uri.getPath(); + + List urlQueries = new ArrayList(); + for (Pair queryParam : queryParams) { + urlQueries.add(queryParam.getName() + "=" + URLEncoder.encode(queryParam.getValue(), "utf8").replaceAll("\\+", "%20")); + } + + if (!urlQueries.isEmpty()) { + path = path + "?" + String.join("&", urlQueries); + } + + headerParams.put("Authorization", signer.sign(method, path, headerParams).toString()); + } catch (Exception ex) { + throw new ApiException("Failed to create signature in the HTTP request header: " + ex.toString()); + } + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java new file mode 100644 index 000000000000..5751094fa1db --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuth.java @@ -0,0 +1,183 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.builder.api.DefaultApi20; +import com.github.scribejava.core.exceptions.OAuthException; +import com.github.scribejava.core.model.OAuth2AccessToken; +import com.github.scribejava.core.oauth.OAuth20Service; + +import javax.ws.rs.core.UriBuilder; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.logging.Level; +import java.util.logging.Logger; + + +public class OAuth implements Authentication { + private static final Logger log = Logger.getLogger(OAuth.class.getName()); + + private String tokenUrl; + private String absoluteTokenUrl; + private OAuthFlow flow = OAuthFlow.application; + private OAuth20Service service; + private DefaultApi20 authApi; + private String scope; + private String username; + private String password; + private String code; + private volatile OAuth2AccessToken accessToken; + + public OAuth(String basePath, String tokenUrl) { + this.tokenUrl = tokenUrl; + this.absoluteTokenUrl = createAbsoluteTokenUrl(basePath, tokenUrl); + authApi = new DefaultApi20() { + @Override + public String getAccessTokenEndpoint() { + return absoluteTokenUrl; + } + + @Override + protected String getAuthorizationBaseUrl() { + throw new UnsupportedOperationException("Shouldn't get there !"); + } + }; + } + + private static String createAbsoluteTokenUrl(String basePath, String tokenUrl) { + if (!URI.create(tokenUrl).isAbsolute()) { + try { + return UriBuilder.fromPath(basePath).path(tokenUrl).build().toURL().toString(); + } catch (MalformedURLException e) { + log.log(Level.SEVERE, "Couldn't create absolute token URL", e); + } + } + return tokenUrl; + } + + @Override + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { + + if (accessToken == null) { + obtainAccessToken(null); + } + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken.getAccessToken()); + } + } + + public OAuth2AccessToken renewAccessToken() throws ApiException { + String refreshToken = null; + if (accessToken != null) { + refreshToken = accessToken.getRefreshToken(); + accessToken = null; + } + return obtainAccessToken(refreshToken); + } + + public synchronized OAuth2AccessToken obtainAccessToken(String refreshToken) throws ApiException { + if (service == null) { + return null; + } + try { + if (refreshToken != null) { + return service.refreshAccessToken(refreshToken); + } + } catch (OAuthException | InterruptedException | ExecutionException | IOException e) { + log.log(Level.FINE, "Refreshing the access token using the refresh token failed", e); + } + try { + switch (flow) { + case password: + if (username != null && password != null) { + accessToken = service.getAccessTokenPasswordGrant(username, password, scope); + } + break; + case accessCode: + if (code != null) { + accessToken = service.getAccessToken(code); + code = null; + } + break; + case application: + accessToken = service.getAccessTokenClientCredentialsGrant(scope); + } + } catch (OAuthException | InterruptedException | ExecutionException | IOException e) { + throw new ApiException(e); + } + return accessToken; + } + + public OAuth2AccessToken getAccessToken() { + return accessToken; + } + + public OAuth setAccessToken(OAuth2AccessToken accessToken) { + this.accessToken = accessToken; + return this; + } + + public OAuth setAccessToken(String accessToken) { + this.accessToken = new OAuth2AccessToken(accessToken); + return this; + } + + public OAuth setScope(String scope) { + this.scope = scope; + return this; + } + + public OAuth setCredentials(String clientId, String clientSecret) { + service = new ServiceBuilder(clientId) + .apiSecret(clientSecret) + .build(authApi); + return this; + } + + public OAuth usePasswordFlow(String username, String password) { + this.flow = OAuthFlow.password; + this.username = username; + this.password = password; + return this; + } + + public OAuth useAuthorizationCodeFlow(String code) { + this.flow = OAuthFlow.accessCode; + this.code = code; + return this; + } + + public OAuth setFlow(OAuthFlow flow) { + this.flow = flow; + return this; + } + + public void setBasePath(String basePath) { + this.absoluteTokenUrl = createAbsoluteTokenUrl(basePath, tokenUrl); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuthFlow.java new file mode 100644 index 000000000000..b2d11ff0c4f0 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -0,0 +1,18 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 000000000000..892694344461 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,127 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ + +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /*** + * Get the list of schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /*** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() {return instance;} + + /*** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /*** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /*** + * Is nullalble + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..624b19e97f3d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,367 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AdditionalPropertiesClass + */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, + AdditionalPropertiesClass.JSON_PROPERTY_EMPTY_MAP, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING +}) + +public class AdditionalPropertiesClass { + public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; + private Map mapProperty = null; + + public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + private Map> mapOfMapProperty = null; + + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + private JsonNullable anytype1 = JsonNullable.of(null); + + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = "map_with_undeclared_properties_anytype_1"; + private Object mapWithUndeclaredPropertiesAnytype1; + + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = "map_with_undeclared_properties_anytype_2"; + private Object mapWithUndeclaredPropertiesAnytype2; + + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3"; + private Map mapWithUndeclaredPropertiesAnytype3 = null; + + public static final String JSON_PROPERTY_EMPTY_MAP = "empty_map"; + private Object emptyMap; + + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string"; + private Map mapWithUndeclaredPropertiesString = null; + + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapProperty + * @return mapProperty + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapProperty() { + return mapProperty; + } + + + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = JsonNullable.of(anytype1); + + return this; + } + + /** + * Get anytype1 + * @return anytype1 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public Object getAnytype1() { + return anytype1.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAnytype1_JsonNullable() { + return anytype1; + } + + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + public void setAnytype1_JsonNullable(JsonNullable anytype1) { + this.anytype1 = anytype1; + } + + public void setAnytype1(Object anytype1) { + this.anytype1 = JsonNullable.of(anytype1); + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { + + this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + return this; + } + + /** + * Get mapWithUndeclaredPropertiesAnytype1 + * @return mapWithUndeclaredPropertiesAnytype1 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getMapWithUndeclaredPropertiesAnytype1() { + return mapWithUndeclaredPropertiesAnytype1; + } + + + public void setMapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { + this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { + + this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + return this; + } + + /** + * Get mapWithUndeclaredPropertiesAnytype2 + * @return mapWithUndeclaredPropertiesAnytype2 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getMapWithUndeclaredPropertiesAnytype2() { + return mapWithUndeclaredPropertiesAnytype2; + } + + + public void setMapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { + this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { + + this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + return this; + } + + public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item(String key, Object mapWithUndeclaredPropertiesAnytype3Item) { + if (this.mapWithUndeclaredPropertiesAnytype3 == null) { + this.mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); + } + this.mapWithUndeclaredPropertiesAnytype3.put(key, mapWithUndeclaredPropertiesAnytype3Item); + return this; + } + + /** + * Get mapWithUndeclaredPropertiesAnytype3 + * @return mapWithUndeclaredPropertiesAnytype3 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapWithUndeclaredPropertiesAnytype3() { + return mapWithUndeclaredPropertiesAnytype3; + } + + + public void setMapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { + this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + } + + + public AdditionalPropertiesClass emptyMap(Object emptyMap) { + + this.emptyMap = emptyMap; + return this; + } + + /** + * an object with no declared properties and no undeclared properties, hence it's an empty map. + * @return emptyMap + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "an object with no declared properties and no undeclared properties, hence it's an empty map.") + @JsonProperty(JSON_PROPERTY_EMPTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getEmptyMap() { + return emptyMap; + } + + + public void setEmptyMap(Object emptyMap) { + this.emptyMap = emptyMap; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { + + this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + return this; + } + + public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem(String key, String mapWithUndeclaredPropertiesStringItem) { + if (this.mapWithUndeclaredPropertiesString == null) { + this.mapWithUndeclaredPropertiesString = new HashMap<>(); + } + this.mapWithUndeclaredPropertiesString.put(key, mapWithUndeclaredPropertiesStringItem); + return this; + } + + /** + * Get mapWithUndeclaredPropertiesString + * @return mapWithUndeclaredPropertiesString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapWithUndeclaredPropertiesString() { + return mapWithUndeclaredPropertiesString; + } + + + public void setMapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { + this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) && + Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) && + Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) && + Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) && + Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) && + Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty, anytype1, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype1: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype1)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype2: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype2)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype3: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype3)).append("\n"); + sb.append(" emptyMap: ").append(toIndentedString(emptyMap)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesString: ").append(toIndentedString(mapWithUndeclaredPropertiesString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 000000000000..307baecc9634 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Cat; +import org.openapitools.client.model.Dog; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Animal + */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), +}) + +public class Animal { + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; + + public static final String JSON_PROPERTY_COLOR = "color"; + private String color = "red"; + + + public Animal className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + public Animal color(String color) { + + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java new file mode 100644 index 000000000000..e74a41ea1991 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Apple + */ +@JsonPropertyOrder({ + Apple.JSON_PROPERTY_CULTIVAR, + Apple.JSON_PROPERTY_ORIGIN +}) + +public class Apple { + public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; + private String cultivar; + + public static final String JSON_PROPERTY_ORIGIN = "origin"; + private String origin; + + + public Apple cultivar(String cultivar) { + + this.cultivar = cultivar; + return this; + } + + /** + * Get cultivar + * @return cultivar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CULTIVAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCultivar() { + return cultivar; + } + + + public void setCultivar(String cultivar) { + this.cultivar = cultivar; + } + + + public Apple origin(String origin) { + + this.origin = origin; + return this; + } + + /** + * Get origin + * @return origin + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ORIGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOrigin() { + return origin; + } + + + public void setOrigin(String origin) { + this.origin = origin; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apple apple = (Apple) o; + return Objects.equals(this.cultivar, apple.cultivar) && + Objects.equals(this.origin, apple.origin); + } + + @Override + public int hashCode() { + return Objects.hash(cultivar, origin); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apple {\n"); + sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java new file mode 100644 index 000000000000..90a3207fc704 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AppleReq + */ +@JsonPropertyOrder({ + AppleReq.JSON_PROPERTY_CULTIVAR, + AppleReq.JSON_PROPERTY_MEALY +}) + +public class AppleReq { + public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; + private String cultivar; + + public static final String JSON_PROPERTY_MEALY = "mealy"; + private Boolean mealy; + + + public AppleReq cultivar(String cultivar) { + + this.cultivar = cultivar; + return this; + } + + /** + * Get cultivar + * @return cultivar + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CULTIVAR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCultivar() { + return cultivar; + } + + + public void setCultivar(String cultivar) { + this.cultivar = cultivar; + } + + + public AppleReq mealy(Boolean mealy) { + + this.mealy = mealy; + return this; + } + + /** + * Get mealy + * @return mealy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MEALY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMealy() { + return mealy; + } + + + public void setMealy(Boolean mealy) { + this.mealy = mealy; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppleReq appleReq = (AppleReq) o; + return Objects.equals(this.cultivar, appleReq.cultivar) && + Objects.equals(this.mealy, appleReq.mealy); + } + + @Override + public int hashCode() { + return Objects.hash(cultivar, mealy); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppleReq {\n"); + sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n"); + sb.append(" mealy: ").append(toIndentedString(mealy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..28d19953c345 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ArrayOfArrayOfNumberOnly + */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) + +public class ArrayOfArrayOfNumberOnly { + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + private List> arrayArrayNumber = null; + + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..5eeac9d8ac5d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ArrayOfNumberOnly + */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) + +public class ArrayOfNumberOnly { + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + private List arrayNumber = null; + + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayNumber() { + return arrayNumber; + } + + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 000000000000..df57098053eb --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,191 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ArrayTest + */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) + +public class ArrayTest { + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + private List arrayOfString = null; + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + private List> arrayArrayOfInteger = null; + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + private List> arrayArrayOfModel = null; + + + public ArrayTest arrayOfString(List arrayOfString) { + + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayOfString() { + return arrayOfString; + } + + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java new file mode 100644 index 000000000000..bb8fd654e455 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Banana + */ +@JsonPropertyOrder({ + Banana.JSON_PROPERTY_LENGTH_CM +}) + +public class Banana { + public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; + private BigDecimal lengthCm; + + + public Banana lengthCm(BigDecimal lengthCm) { + + this.lengthCm = lengthCm; + return this; + } + + /** + * Get lengthCm + * @return lengthCm + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LENGTH_CM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getLengthCm() { + return lengthCm; + } + + + public void setLengthCm(BigDecimal lengthCm) { + this.lengthCm = lengthCm; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Banana banana = (Banana) o; + return Objects.equals(this.lengthCm, banana.lengthCm); + } + + @Override + public int hashCode() { + return Objects.hash(lengthCm); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Banana {\n"); + sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java new file mode 100644 index 000000000000..719d1034095d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BananaReq + */ +@JsonPropertyOrder({ + BananaReq.JSON_PROPERTY_LENGTH_CM, + BananaReq.JSON_PROPERTY_SWEET +}) + +public class BananaReq { + public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; + private BigDecimal lengthCm; + + public static final String JSON_PROPERTY_SWEET = "sweet"; + private Boolean sweet; + + + public BananaReq lengthCm(BigDecimal lengthCm) { + + this.lengthCm = lengthCm; + return this; + } + + /** + * Get lengthCm + * @return lengthCm + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_LENGTH_CM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getLengthCm() { + return lengthCm; + } + + + public void setLengthCm(BigDecimal lengthCm) { + this.lengthCm = lengthCm; + } + + + public BananaReq sweet(Boolean sweet) { + + this.sweet = sweet; + return this; + } + + /** + * Get sweet + * @return sweet + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SWEET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSweet() { + return sweet; + } + + + public void setSweet(Boolean sweet) { + this.sweet = sweet; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BananaReq bananaReq = (BananaReq) o; + return Objects.equals(this.lengthCm, bananaReq.lengthCm) && + Objects.equals(this.sweet, bananaReq.sweet); + } + + @Override + public int hashCode() { + return Objects.hash(lengthCm, sweet); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BananaReq {\n"); + sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n"); + sb.append(" sweet: ").append(toIndentedString(sweet)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java new file mode 100644 index 000000000000..d13bc304b2da --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BasquePig + */ +@JsonPropertyOrder({ + BasquePig.JSON_PROPERTY_CLASS_NAME +}) + +public class BasquePig { + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; + + + public BasquePig className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BasquePig basquePig = (BasquePig) o; + return Objects.equals(this.className, basquePig.className); + } + + @Override + public int hashCode() { + return Objects.hash(className); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BasquePig {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 000000000000..033e97881105 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,257 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Capitalization + */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) + +public class Capitalization { + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + private String smallCamel; + + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + private String capitalCamel; + + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + private String smallSnake; + + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + private String capitalSnake; + + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + private String scAETHFlowPoints; + + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + private String ATT_NAME; + + + public Capitalization smallCamel(String smallCamel) { + + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmallCamel() { + return smallCamel; + } + + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + + public Capitalization capitalCamel(String capitalCamel) { + + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCapitalCamel() { + return capitalCamel; + } + + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + + public Capitalization smallSnake(String smallSnake) { + + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmallSnake() { + return smallSnake; + } + + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + + public Capitalization capitalSnake(String capitalSnake) { + + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCapitalSnake() { + return capitalSnake; + } + + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + + public Capitalization ATT_NAME(String ATT_NAME) { + + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getATTNAME() { + return ATT_NAME; + } + + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 000000000000..05e080b32291 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Cat + */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) +@JsonSubTypes({ +}) + +public class Cat extends Animal { + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + private Boolean declawed; + + + public Cat declawed(Boolean declawed) { + + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDeclawed() { + return declawed; + } + + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java new file mode 100644 index 000000000000..3e7b991436aa --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * CatAllOf + */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) + +public class CatAllOf { + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + private Boolean declawed; + + + public CatAllOf declawed(Boolean declawed) { + + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDeclawed() { + return declawed; + } + + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(this.declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 000000000000..868ba8750742 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Category + */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) + +public class Category { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name = "default-name"; + + + public Category id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Category name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java new file mode 100644 index 000000000000..272be70fc2a6 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ChildCatAllOf; +import org.openapitools.client.model.ParentPet; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ChildCat + */ +@JsonPropertyOrder({ + ChildCat.JSON_PROPERTY_NAME +}) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "pet_type", visible = true) +@JsonSubTypes({ +}) + +public class ChildCat extends ParentPet { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + + public ChildCat name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildCat childCat = (ChildCat) o; + return Objects.equals(this.name, childCat.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java new file mode 100644 index 000000000000..aa495e74cd43 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ChildCatAllOf + */ +@JsonPropertyOrder({ + ChildCatAllOf.JSON_PROPERTY_NAME +}) + +public class ChildCatAllOf { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + + public ChildCatAllOf name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildCatAllOf childCatAllOf = (ChildCatAllOf) o; + return Objects.equals(this.name, childCatAllOf.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildCatAllOf {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 000000000000..4de7664b26a7 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Model for testing model with \"_class\" property + */ +@ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) + +public class ClassModel { + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + private String propertyClass; + + + public ClassModel propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPropertyClass() { + return propertyClass; + } + + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 000000000000..02b0aac2247a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Client + */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) + +public class Client { + public static final String JSON_PROPERTY_CLIENT = "client"; + private String client; + + + public Client client(String client) { + + this.client = client; + return this; + } + + /** + * Get client + * @return client + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClient() { + return client; + } + + + public void setClient(String client) { + this.client = client; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java new file mode 100644 index 000000000000..7e99e3ec4bf6 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.QuadrilateralInterface; +import org.openapitools.client.model.ShapeInterface; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ComplexQuadrilateral + */ +@JsonPropertyOrder({ + ComplexQuadrilateral.JSON_PROPERTY_SHAPE_TYPE, + ComplexQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE +}) + +public class ComplexQuadrilateral { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; + + public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + private String quadrilateralType; + + + public ComplexQuadrilateral shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + public ComplexQuadrilateral quadrilateralType(String quadrilateralType) { + + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * @return quadrilateralType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getQuadrilateralType() { + return quadrilateralType; + } + + + public void setQuadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComplexQuadrilateral complexQuadrilateral = (ComplexQuadrilateral) o; + return Objects.equals(this.shapeType, complexQuadrilateral.shapeType) && + Objects.equals(this.quadrilateralType, complexQuadrilateral.quadrilateralType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, quadrilateralType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComplexQuadrilateral {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java new file mode 100644 index 000000000000..cf4907374211 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * DanishPig + */ +@JsonPropertyOrder({ + DanishPig.JSON_PROPERTY_CLASS_NAME +}) + +public class DanishPig { + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; + + + public DanishPig className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DanishPig danishPig = (DanishPig) o; + return Objects.equals(this.className, danishPig.className); + } + + @Override + public int hashCode() { + return Objects.hash(className); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DanishPig {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 000000000000..f56658043689 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Dog + */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) +@JsonSubTypes({ +}) + +public class Dog extends Animal { + public static final String JSON_PROPERTY_BREED = "breed"; + private String breed; + + + public Dog breed(String breed) { + + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBreed() { + return breed; + } + + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java new file mode 100644 index 000000000000..dd42595cf202 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * DogAllOf + */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) + +public class DogAllOf { + public static final String JSON_PROPERTY_BREED = "breed"; + private String breed; + + + public DogAllOf breed(String breed) { + + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBreed() { + return breed; + } + + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(this.breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java new file mode 100644 index 000000000000..f92f7d3f461d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java @@ -0,0 +1,226 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.Fruit; +import org.openapitools.client.model.NullableShape; +import org.openapitools.client.model.Shape; +import org.openapitools.client.model.ShapeOrNull; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Drawing + */ +@JsonPropertyOrder({ + Drawing.JSON_PROPERTY_MAIN_SHAPE, + Drawing.JSON_PROPERTY_SHAPE_OR_NULL, + Drawing.JSON_PROPERTY_NULLABLE_SHAPE, + Drawing.JSON_PROPERTY_SHAPES +}) + +public class Drawing extends HashMap { + public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape"; + private Shape mainShape = null; + + public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull"; + private ShapeOrNull shapeOrNull = null; + + public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape"; + private JsonNullable nullableShape = JsonNullable.of(null); + + public static final String JSON_PROPERTY_SHAPES = "shapes"; + private List shapes = null; + + + public Drawing mainShape(Shape mainShape) { + + this.mainShape = mainShape; + return this; + } + + /** + * Get mainShape + * @return mainShape + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAIN_SHAPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Shape getMainShape() { + return mainShape; + } + + + public void setMainShape(Shape mainShape) { + this.mainShape = mainShape; + } + + + public Drawing shapeOrNull(ShapeOrNull shapeOrNull) { + + this.shapeOrNull = shapeOrNull; + return this; + } + + /** + * Get shapeOrNull + * @return shapeOrNull + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ShapeOrNull getShapeOrNull() { + return shapeOrNull; + } + + + public void setShapeOrNull(ShapeOrNull shapeOrNull) { + this.shapeOrNull = shapeOrNull; + } + + + public Drawing nullableShape(NullableShape nullableShape) { + this.nullableShape = JsonNullable.of(nullableShape); + + return this; + } + + /** + * Get nullableShape + * @return nullableShape + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public NullableShape getNullableShape() { + return nullableShape.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_SHAPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNullableShape_JsonNullable() { + return nullableShape; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_SHAPE) + public void setNullableShape_JsonNullable(JsonNullable nullableShape) { + this.nullableShape = nullableShape; + } + + public void setNullableShape(NullableShape nullableShape) { + this.nullableShape = JsonNullable.of(nullableShape); + } + + + public Drawing shapes(List shapes) { + + this.shapes = shapes; + return this; + } + + public Drawing addShapesItem(Shape shapesItem) { + if (this.shapes == null) { + this.shapes = new ArrayList<>(); + } + this.shapes.add(shapesItem); + return this; + } + + /** + * Get shapes + * @return shapes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHAPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getShapes() { + return shapes; + } + + + public void setShapes(List shapes) { + this.shapes = shapes; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Drawing drawing = (Drawing) o; + return Objects.equals(this.mainShape, drawing.mainShape) && + Objects.equals(this.shapeOrNull, drawing.shapeOrNull) && + Objects.equals(this.nullableShape, drawing.nullableShape) && + Objects.equals(this.shapes, drawing.shapes) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(mainShape, shapeOrNull, nullableShape, shapes, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Drawing {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" mainShape: ").append(toIndentedString(mainShape)).append("\n"); + sb.append(" shapeOrNull: ").append(toIndentedString(shapeOrNull)).append("\n"); + sb.append(" nullableShape: ").append(toIndentedString(nullableShape)).append("\n"); + sb.append(" shapes: ").append(toIndentedString(shapes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 000000000000..86526adb3fa7 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,213 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * EnumArrays + */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) + +public class EnumArrays { + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + private JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + private List arrayEnum = null; + + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + + public EnumArrays arrayEnum(List arrayEnum) { + + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayEnum() { + return arrayEnum; + } + + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 000000000000..e9102d974276 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 000000000000..cf6d574a5f97 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,479 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * EnumTest + */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE +}) + +public class EnumTest { + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + private EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + private EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + private EnumNumberEnum enumNumber; + + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + private JsonNullable outerEnum = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; + private OuterEnumInteger outerEnumInteger; + + public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + + public EnumTest enumString(EnumStringEnum enumString) { + + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumStringEnum getEnumString() { + return enumString; + } + + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); + + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public OuterEnum getOuterEnum() { + return outerEnum.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getOuterEnum_JsonNullable() { + return outerEnum; + } + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + public void setOuterEnum_JsonNullable(JsonNullable outerEnum) { + this.outerEnum = outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); + } + + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java new file mode 100644 index 000000000000..6e93c9efbf8d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * EquilateralTriangle + */ +@JsonPropertyOrder({ + EquilateralTriangle.JSON_PROPERTY_SHAPE_TYPE, + EquilateralTriangle.JSON_PROPERTY_TRIANGLE_TYPE +}) + +public class EquilateralTriangle { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; + + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + private String triangleType; + + + public EquilateralTriangle shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + public EquilateralTriangle triangleType(String triangleType) { + + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTriangleType() { + return triangleType; + } + + + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o; + return Objects.equals(this.shapeType, equilateralTriangle.shapeType) && + Objects.equals(this.triangleType, equilateralTriangle.triangleType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, triangleType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EquilateralTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..cfd62fbce628 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * FileSchemaTestClass + */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) + +public class FileSchemaTestClass { + public static final String JSON_PROPERTY_FILE = "file"; + private java.io.File file; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + + public FileSchemaTestClass file(java.io.File file) { + + this.file = file; + return this; + } + + /** + * Get file + * @return file + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public java.io.File getFile() { + return file; + } + + + public void setFile(java.io.File file) { + this.file = file; + } + + + public FileSchemaTestClass files(List files) { + + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(java.io.File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + public void setFiles(List files) { + this.files = files; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this.file, fileSchemaTestClass.file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(file, files); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 000000000000..e531ce87dbf2 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Foo + */ +@JsonPropertyOrder({ + Foo.JSON_PROPERTY_BAR +}) + +public class Foo { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar = "bar"; + + + public Foo bar(String bar) { + + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + public void setBar(String bar) { + this.bar = bar; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); + } + + @Override + public int hashCode() { + return Objects.hash(bar); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 000000000000..4440eda8d8e7 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,547 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * FormatTest + */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER +}) + +public class FormatTest { + public static final String JSON_PROPERTY_INTEGER = "integer"; + private Integer integer; + + public static final String JSON_PROPERTY_INT32 = "int32"; + private Integer int32; + + public static final String JSON_PROPERTY_INT64 = "int64"; + private Long int64; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; + + public static final String JSON_PROPERTY_STRING = "string"; + private String string; + + public static final String JSON_PROPERTY_BYTE = "byte"; + private byte[] _byte; + + public static final String JSON_PROPERTY_BINARY = "binary"; + private File binary; + + public static final String JSON_PROPERTY_DATE = "date"; + private LocalDate date; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; + private String patternWithDigits; + + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; + private String patternWithDigitsAndDelimiter; + + + public FormatTest integer(Integer integer) { + + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInteger() { + return integer; + } + + + public void setInteger(Integer integer) { + this.integer = integer; + } + + + public FormatTest int32(Integer int32) { + + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInt32() { + return int32; + } + + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + + public FormatTest int64(Long int64) { + + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getInt64() { + return int64; + } + + + public void setInt64(Long int64) { + this.int64 = int64; + } + + + public FormatTest number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public FormatTest _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getFloat() { + return _float; + } + + + public void setFloat(Float _float) { + this._float = _float; + } + + + public FormatTest _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getDouble() { + return _double; + } + + + public void setDouble(Double _double) { + this._double = _double; + } + + + public FormatTest string(String string) { + + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getString() { + return string; + } + + + public void setString(String string) { + this.string = string; + } + + + public FormatTest _byte(byte[] _byte) { + + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public byte[] getByte() { + return _byte; + } + + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + + public FormatTest binary(File binary) { + + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getBinary() { + return binary; + } + + + public void setBinary(File binary) { + this.binary = binary; + } + + + public FormatTest date(LocalDate date) { + + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LocalDate getDate() { + return date; + } + + + public void setDate(LocalDate date) { + this.date = date; + } + + + public FormatTest dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + + public FormatTest uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UUID getUuid() { + return uuid; + } + + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + + public FormatTest password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public FormatTest patternWithDigits(String patternWithDigits) { + + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.") + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPatternWithDigits() { + return patternWithDigits; + } + + + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java new file mode 100644 index 000000000000..a9eeee525b6e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=Fruit.FruitDeserializer.class) +public class Fruit extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Fruit.class.getName()); + + public static class FruitDeserializer extends StdDeserializer { + public FruitDeserializer() { + this(Fruit.class); + } + + public FruitDeserializer(Class vc) { + super(vc); + } + + @Override + public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize Apple + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Apple'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Apple'", e); + } + + // deserialize Banana + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Banana'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Banana'", e); + } + + if (match == 1) { + Fruit ret = new Fruit(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for Fruit: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public Fruit() { + super("oneOf", Boolean.FALSE); + } + + public Fruit(Apple o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Fruit(Banana o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Apple", new GenericType() { + }); + schemas.put("Banana", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Fruit.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Apple) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Banana) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); + } + + + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java new file mode 100644 index 000000000000..2a46202a7ed3 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.openapitools.client.model.AppleReq; +import org.openapitools.client.model.BananaReq; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=FruitReq.FruitReqDeserializer.class) +public class FruitReq extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(FruitReq.class.getName()); + + public static class FruitReqDeserializer extends StdDeserializer { + public FruitReqDeserializer() { + this(FruitReq.class); + } + + public FruitReqDeserializer(Class vc) { + super(vc); + } + + @Override + public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize AppleReq + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(AppleReq.class); + match++; + log.log(Level.FINER, "Input data matches schema 'AppleReq'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'AppleReq'", e); + } + + // deserialize BananaReq + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(BananaReq.class); + match++; + log.log(Level.FINER, "Input data matches schema 'BananaReq'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'BananaReq'", e); + } + + if (match == 1) { + FruitReq ret = new FruitReq(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for FruitReq: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public FruitReq() { + super("oneOf", Boolean.TRUE); + } + + public FruitReq(AppleReq o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + public FruitReq(BananaReq o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + static { + schemas.put("AppleReq", new GenericType() { + }); + schemas.put("BananaReq", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return FruitReq.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AppleReq) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof BananaReq) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AppleReq, BananaReq"); + } + + + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java new file mode 100644 index 000000000000..6dd57e7c3a55 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=GmFruit.GmFruitDeserializer.class) +public class GmFruit extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GmFruit.class.getName()); + + public static class GmFruitDeserializer extends StdDeserializer { + public GmFruitDeserializer() { + this(GmFruit.class); + } + + public GmFruitDeserializer(Class vc) { + super(vc); + } + + @Override + public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialzie Apple + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); + GmFruit ret = new GmFruit(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruit'", e); + } + + // deserialzie Banana + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + GmFruit ret = new GmFruit(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruit'", e); + } + + throw new IOException(String.format("Failed deserialization for GmFruit: no match found")); + } + } + + // store a list of schema names defined in anyOf + public final static Map schemas = new HashMap(); + + public GmFruit() { + super("anyOf", Boolean.FALSE); + } + + public GmFruit(Apple o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public GmFruit(Banana o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Apple", new GenericType() { + }); + schemas.put("Banana", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return GmFruit.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Apple) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Banana) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); + } +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java new file mode 100644 index 000000000000..18f7c9f55be0 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ChildCat; +import org.openapitools.client.model.ParentPet; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * GrandparentAnimal + */ +@JsonPropertyOrder({ + GrandparentAnimal.JSON_PROPERTY_PET_TYPE +}) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "pet_type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"), + @JsonSubTypes.Type(value = ParentPet.class, name = "ParentPet"), +}) + +public class GrandparentAnimal { + public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + private String petType; + + + public GrandparentAnimal petType(String petType) { + + this.petType = petType; + return this; + } + + /** + * Get petType + * @return petType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PET_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPetType() { + return petType; + } + + + public void setPetType(String petType) { + this.petType = petType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrandparentAnimal grandparentAnimal = (GrandparentAnimal) o; + return Objects.equals(this.petType, grandparentAnimal.petType); + } + + @Override + public int hashCode() { + return Objects.hash(petType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrandparentAnimal {\n"); + sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..0a3f0d464360 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,115 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * HasOnlyReadOnly + */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) + +public class HasOnlyReadOnly { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; + + public static final String JSON_PROPERTY_FOO = "foo"; + private String foo; + + + /** + * Get bar + * @return bar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + + + /** + * Get foo + * @return foo + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFoo() { + return foo; + } + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 000000000000..efb77061df17 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,116 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + */ +@ApiModel(description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") +@JsonPropertyOrder({ + HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE +}) + +public class HealthCheckResult { + public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; + private JsonNullable nullableMessage = JsonNullable.undefined(); + + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + + return this; + } + + /** + * Get nullableMessage + * @return nullableMessage + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public String getNullableMessage() { + return nullableMessage.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNullableMessage_JsonNullable() { + return nullableMessage; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + public void setNullableMessage_JsonNullable(JsonNullable nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return Objects.equals(this.nullableMessage, healthCheckResult.nullableMessage); + } + + @Override + public int hashCode() { + return Objects.hash(nullableMessage); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject.java new file mode 100644 index 000000000000..bb0804c5240e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * InlineObject + */ +@JsonPropertyOrder({ + InlineObject.JSON_PROPERTY_NAME, + InlineObject.JSON_PROPERTY_STATUS +}) + +public class InlineObject { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + + public InlineObject name(String name) { + + this.name = name; + return this; + } + + /** + * Updated name of the pet + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Updated name of the pet") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public InlineObject status(String status) { + + this.status = status; + return this; + } + + /** + * Updated status of the pet + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Updated status of the pet") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject inlineObject = (InlineObject) o; + return Objects.equals(this.name, inlineObject.name) && + Objects.equals(this.status, inlineObject.status); + } + + @Override + public int hashCode() { + return Objects.hash(name, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject1.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject1.java new file mode 100644 index 000000000000..99b98f4c848e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject1.java @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * InlineObject1 + */ +@JsonPropertyOrder({ + InlineObject1.JSON_PROPERTY_ADDITIONAL_METADATA, + InlineObject1.JSON_PROPERTY_FILE +}) + +public class InlineObject1 { + public static final String JSON_PROPERTY_ADDITIONAL_METADATA = "additionalMetadata"; + private String additionalMetadata; + + public static final String JSON_PROPERTY_FILE = "file"; + private File file; + + + public InlineObject1 additionalMetadata(String additionalMetadata) { + + this.additionalMetadata = additionalMetadata; + return this; + } + + /** + * Additional data to pass to server + * @return additionalMetadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Additional data to pass to server") + @JsonProperty(JSON_PROPERTY_ADDITIONAL_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAdditionalMetadata() { + return additionalMetadata; + } + + + public void setAdditionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + } + + + public InlineObject1 file(File file) { + + this.file = file; + return this; + } + + /** + * file to upload + * @return file + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "file to upload") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getFile() { + return file; + } + + + public void setFile(File file) { + this.file = file; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject1 inlineObject1 = (InlineObject1) o; + return Objects.equals(this.additionalMetadata, inlineObject1.additionalMetadata) && + Objects.equals(this.file, inlineObject1.file); + } + + @Override + public int hashCode() { + return Objects.hash(additionalMetadata, file); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject1 {\n"); + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject2.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject2.java new file mode 100644 index 000000000000..468545bb3427 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject2.java @@ -0,0 +1,215 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * InlineObject2 + */ +@JsonPropertyOrder({ + InlineObject2.JSON_PROPERTY_ENUM_FORM_STRING_ARRAY, + InlineObject2.JSON_PROPERTY_ENUM_FORM_STRING +}) + +public class InlineObject2 { + /** + * Gets or Sets enumFormStringArray + */ + public enum EnumFormStringArrayEnum { + GREATER_THAN(">"), + + DOLLAR("$"); + + private String value; + + EnumFormStringArrayEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumFormStringArrayEnum fromValue(String value) { + for (EnumFormStringArrayEnum b : EnumFormStringArrayEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_FORM_STRING_ARRAY = "enum_form_string_array"; + private List enumFormStringArray = null; + + /** + * Form parameter enum test (string) + */ + public enum EnumFormStringEnum { + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumFormStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumFormStringEnum fromValue(String value) { + for (EnumFormStringEnum b : EnumFormStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_FORM_STRING = "enum_form_string"; + private EnumFormStringEnum enumFormString = EnumFormStringEnum._EFG; + + + public InlineObject2 enumFormStringArray(List enumFormStringArray) { + + this.enumFormStringArray = enumFormStringArray; + return this; + } + + public InlineObject2 addEnumFormStringArrayItem(EnumFormStringArrayEnum enumFormStringArrayItem) { + if (this.enumFormStringArray == null) { + this.enumFormStringArray = new ArrayList<>(); + } + this.enumFormStringArray.add(enumFormStringArrayItem); + return this; + } + + /** + * Form parameter enum test (string array) + * @return enumFormStringArray + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Form parameter enum test (string array)") + @JsonProperty(JSON_PROPERTY_ENUM_FORM_STRING_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEnumFormStringArray() { + return enumFormStringArray; + } + + + public void setEnumFormStringArray(List enumFormStringArray) { + this.enumFormStringArray = enumFormStringArray; + } + + + public InlineObject2 enumFormString(EnumFormStringEnum enumFormString) { + + this.enumFormString = enumFormString; + return this; + } + + /** + * Form parameter enum test (string) + * @return enumFormString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Form parameter enum test (string)") + @JsonProperty(JSON_PROPERTY_ENUM_FORM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumFormStringEnum getEnumFormString() { + return enumFormString; + } + + + public void setEnumFormString(EnumFormStringEnum enumFormString) { + this.enumFormString = enumFormString; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject2 inlineObject2 = (InlineObject2) o; + return Objects.equals(this.enumFormStringArray, inlineObject2.enumFormStringArray) && + Objects.equals(this.enumFormString, inlineObject2.enumFormString); + } + + @Override + public int hashCode() { + return Objects.hash(enumFormStringArray, enumFormString); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject2 {\n"); + sb.append(" enumFormStringArray: ").append(toIndentedString(enumFormStringArray)).append("\n"); + sb.append(" enumFormString: ").append(toIndentedString(enumFormString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject3.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject3.java new file mode 100644 index 000000000000..ed083c6ab539 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject3.java @@ -0,0 +1,514 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * InlineObject3 + */ +@JsonPropertyOrder({ + InlineObject3.JSON_PROPERTY_INTEGER, + InlineObject3.JSON_PROPERTY_INT32, + InlineObject3.JSON_PROPERTY_INT64, + InlineObject3.JSON_PROPERTY_NUMBER, + InlineObject3.JSON_PROPERTY_FLOAT, + InlineObject3.JSON_PROPERTY_DOUBLE, + InlineObject3.JSON_PROPERTY_STRING, + InlineObject3.JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER, + InlineObject3.JSON_PROPERTY_BYTE, + InlineObject3.JSON_PROPERTY_BINARY, + InlineObject3.JSON_PROPERTY_DATE, + InlineObject3.JSON_PROPERTY_DATE_TIME, + InlineObject3.JSON_PROPERTY_PASSWORD, + InlineObject3.JSON_PROPERTY_CALLBACK +}) + +public class InlineObject3 { + public static final String JSON_PROPERTY_INTEGER = "integer"; + private Integer integer; + + public static final String JSON_PROPERTY_INT32 = "int32"; + private Integer int32; + + public static final String JSON_PROPERTY_INT64 = "int64"; + private Long int64; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; + + public static final String JSON_PROPERTY_STRING = "string"; + private String string; + + public static final String JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER = "pattern_without_delimiter"; + private String patternWithoutDelimiter; + + public static final String JSON_PROPERTY_BYTE = "byte"; + private byte[] _byte; + + public static final String JSON_PROPERTY_BINARY = "binary"; + private File binary; + + public static final String JSON_PROPERTY_DATE = "date"; + private LocalDate date; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_CALLBACK = "callback"; + private String callback; + + + public InlineObject3 integer(Integer integer) { + + this.integer = integer; + return this; + } + + /** + * None + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInteger() { + return integer; + } + + + public void setInteger(Integer integer) { + this.integer = integer; + } + + + public InlineObject3 int32(Integer int32) { + + this.int32 = int32; + return this; + } + + /** + * None + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInt32() { + return int32; + } + + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + + public InlineObject3 int64(Long int64) { + + this.int64 = int64; + return this; + } + + /** + * None + * @return int64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getInt64() { + return int64; + } + + + public void setInt64(Long int64) { + this.int64 = int64; + } + + + public InlineObject3 number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * None + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @ApiModelProperty(required = true, value = "None") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public InlineObject3 _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * None + * maximum: 987.6 + * @return _float + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getFloat() { + return _float; + } + + + public void setFloat(Float _float) { + this._float = _float; + } + + + public InlineObject3 _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * None + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @ApiModelProperty(required = true, value = "None") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Double getDouble() { + return _double; + } + + + public void setDouble(Double _double) { + this._double = _double; + } + + + public InlineObject3 string(String string) { + + this.string = string; + return this; + } + + /** + * None + * @return string + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getString() { + return string; + } + + + public void setString(String string) { + this.string = string; + } + + + public InlineObject3 patternWithoutDelimiter(String patternWithoutDelimiter) { + + this.patternWithoutDelimiter = patternWithoutDelimiter; + return this; + } + + /** + * None + * @return patternWithoutDelimiter + **/ + @ApiModelProperty(required = true, value = "None") + @JsonProperty(JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPatternWithoutDelimiter() { + return patternWithoutDelimiter; + } + + + public void setPatternWithoutDelimiter(String patternWithoutDelimiter) { + this.patternWithoutDelimiter = patternWithoutDelimiter; + } + + + public InlineObject3 _byte(byte[] _byte) { + + this._byte = _byte; + return this; + } + + /** + * None + * @return _byte + **/ + @ApiModelProperty(required = true, value = "None") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public byte[] getByte() { + return _byte; + } + + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + + public InlineObject3 binary(File binary) { + + this.binary = binary; + return this; + } + + /** + * None + * @return binary + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getBinary() { + return binary; + } + + + public void setBinary(File binary) { + this.binary = binary; + } + + + public InlineObject3 date(LocalDate date) { + + this.date = date; + return this; + } + + /** + * None + * @return date + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LocalDate getDate() { + return date; + } + + + public void setDate(LocalDate date) { + this.date = date; + } + + + public InlineObject3 dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * None + * @return dateTime + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + + public InlineObject3 password(String password) { + + this.password = password; + return this; + } + + /** + * None + * @return password + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public InlineObject3 callback(String callback) { + + this.callback = callback; + return this; + } + + /** + * None + * @return callback + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_CALLBACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCallback() { + return callback; + } + + + public void setCallback(String callback) { + this.callback = callback; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject3 inlineObject3 = (InlineObject3) o; + return Objects.equals(this.integer, inlineObject3.integer) && + Objects.equals(this.int32, inlineObject3.int32) && + Objects.equals(this.int64, inlineObject3.int64) && + Objects.equals(this.number, inlineObject3.number) && + Objects.equals(this._float, inlineObject3._float) && + Objects.equals(this._double, inlineObject3._double) && + Objects.equals(this.string, inlineObject3.string) && + Objects.equals(this.patternWithoutDelimiter, inlineObject3.patternWithoutDelimiter) && + Arrays.equals(this._byte, inlineObject3._byte) && + Objects.equals(this.binary, inlineObject3.binary) && + Objects.equals(this.date, inlineObject3.date) && + Objects.equals(this.dateTime, inlineObject3.dateTime) && + Objects.equals(this.password, inlineObject3.password) && + Objects.equals(this.callback, inlineObject3.callback); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, string, patternWithoutDelimiter, Arrays.hashCode(_byte), binary, date, dateTime, password, callback); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject3 {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" patternWithoutDelimiter: ").append(toIndentedString(patternWithoutDelimiter)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" callback: ").append(toIndentedString(callback)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject4.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject4.java new file mode 100644 index 000000000000..953ca1d5b2bc --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject4.java @@ -0,0 +1,131 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * InlineObject4 + */ +@JsonPropertyOrder({ + InlineObject4.JSON_PROPERTY_PARAM, + InlineObject4.JSON_PROPERTY_PARAM2 +}) + +public class InlineObject4 { + public static final String JSON_PROPERTY_PARAM = "param"; + private String param; + + public static final String JSON_PROPERTY_PARAM2 = "param2"; + private String param2; + + + public InlineObject4 param(String param) { + + this.param = param; + return this; + } + + /** + * field1 + * @return param + **/ + @ApiModelProperty(required = true, value = "field1") + @JsonProperty(JSON_PROPERTY_PARAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getParam() { + return param; + } + + + public void setParam(String param) { + this.param = param; + } + + + public InlineObject4 param2(String param2) { + + this.param2 = param2; + return this; + } + + /** + * field2 + * @return param2 + **/ + @ApiModelProperty(required = true, value = "field2") + @JsonProperty(JSON_PROPERTY_PARAM2) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getParam2() { + return param2; + } + + + public void setParam2(String param2) { + this.param2 = param2; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject4 inlineObject4 = (InlineObject4) o; + return Objects.equals(this.param, inlineObject4.param) && + Objects.equals(this.param2, inlineObject4.param2); + } + + @Override + public int hashCode() { + return Objects.hash(param, param2); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject4 {\n"); + sb.append(" param: ").append(toIndentedString(param)).append("\n"); + sb.append(" param2: ").append(toIndentedString(param2)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject5.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject5.java new file mode 100644 index 000000000000..1b079adfcf91 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject5.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * InlineObject5 + */ +@JsonPropertyOrder({ + InlineObject5.JSON_PROPERTY_ADDITIONAL_METADATA, + InlineObject5.JSON_PROPERTY_REQUIRED_FILE +}) + +public class InlineObject5 { + public static final String JSON_PROPERTY_ADDITIONAL_METADATA = "additionalMetadata"; + private String additionalMetadata; + + public static final String JSON_PROPERTY_REQUIRED_FILE = "requiredFile"; + private File requiredFile; + + + public InlineObject5 additionalMetadata(String additionalMetadata) { + + this.additionalMetadata = additionalMetadata; + return this; + } + + /** + * Additional data to pass to server + * @return additionalMetadata + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Additional data to pass to server") + @JsonProperty(JSON_PROPERTY_ADDITIONAL_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAdditionalMetadata() { + return additionalMetadata; + } + + + public void setAdditionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + } + + + public InlineObject5 requiredFile(File requiredFile) { + + this.requiredFile = requiredFile; + return this; + } + + /** + * file to upload + * @return requiredFile + **/ + @ApiModelProperty(required = true, value = "file to upload") + @JsonProperty(JSON_PROPERTY_REQUIRED_FILE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public File getRequiredFile() { + return requiredFile; + } + + + public void setRequiredFile(File requiredFile) { + this.requiredFile = requiredFile; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject5 inlineObject5 = (InlineObject5) o; + return Objects.equals(this.additionalMetadata, inlineObject5.additionalMetadata) && + Objects.equals(this.requiredFile, inlineObject5.requiredFile); + } + + @Override + public int hashCode() { + return Objects.hash(additionalMetadata, requiredFile); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject5 {\n"); + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); + sb.append(" requiredFile: ").append(toIndentedString(requiredFile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java new file mode 100644 index 000000000000..6b90bf2a18fa --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Foo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * InlineResponseDefault + */ +@JsonPropertyOrder({ + InlineResponseDefault.JSON_PROPERTY_STRING +}) + +public class InlineResponseDefault { + public static final String JSON_PROPERTY_STRING = "string"; + private Foo string; + + + public InlineResponseDefault string(Foo string) { + + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Foo getString() { + return string; + } + + + public void setString(Foo string) { + this.string = string; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponseDefault inlineResponseDefault = (InlineResponseDefault) o; + return Objects.equals(this.string, inlineResponseDefault.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponseDefault {\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java new file mode 100644 index 000000000000..6282304a20bd --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * IsoscelesTriangle + */ +@JsonPropertyOrder({ + IsoscelesTriangle.JSON_PROPERTY_SHAPE_TYPE, + IsoscelesTriangle.JSON_PROPERTY_TRIANGLE_TYPE +}) + +public class IsoscelesTriangle { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; + + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + private String triangleType; + + + public IsoscelesTriangle shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + public IsoscelesTriangle triangleType(String triangleType) { + + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTriangleType() { + return triangleType; + } + + + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsoscelesTriangle isoscelesTriangle = (IsoscelesTriangle) o; + return Objects.equals(this.shapeType, isoscelesTriangle.shapeType) && + Objects.equals(this.triangleType, isoscelesTriangle.triangleType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, triangleType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsoscelesTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java new file mode 100644 index 000000000000..dff6e3b29c0b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=Mammal.MammalDeserializer.class) +public class Mammal extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Mammal.class.getName()); + + public static class MammalDeserializer extends StdDeserializer { + public MammalDeserializer() { + this(Mammal.class); + } + + public MammalDeserializer(Class vc) { + super(vc); + } + + @Override + public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize Pig + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Pig'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Pig'", e); + } + + // deserialize Whale + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Whale'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Whale'", e); + } + + // deserialize Zebra + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Zebra'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Zebra'", e); + } + + if (match == 1) { + Mammal ret = new Mammal(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for Mammal: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public Mammal() { + super("oneOf", Boolean.FALSE); + } + + public Mammal(Pig o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Mammal(Whale o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Mammal(Zebra o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Pig", new GenericType() { + }); + schemas.put("Whale", new GenericType() { + }); + schemas.put("Zebra", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Mammal.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Pig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Whale) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Zebra) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra"); + } + + + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 000000000000..3e72350aa8b1 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,265 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MapTest + */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) + +public class MapTest { + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + private Map> mapMapOfString = null; + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + private Map mapOfEnumString = null; + + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + private Map directMap = null; + + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + private Map indirectMap = null; + + + public MapTest mapMapOfString(Map> mapMapOfString) { + + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapMapOfString() { + return mapMapOfString; + } + + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + + public MapTest mapOfEnumString(Map mapOfEnumString) { + + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + + public MapTest directMap(Map directMap) { + + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getDirectMap() { + return directMap; + } + + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + + public MapTest indirectMap(Map indirectMap) { + + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getIndirectMap() { + return indirectMap; + } + + + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..07d314691a97 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,178 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) + +public class MixedPropertiesAndAdditionalPropertiesClass { + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_MAP = "map"; + private Map map = null; + + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UUID getUuid() { + return uuid; + } + + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMap() { + return map; + } + + + public void setMap(Map map) { + this.map = map; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 000000000000..dd99468a0059 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Model for testing model name starting with number + */ +@ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) + +public class Model200Response { + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; + + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + private String propertyClass; + + + public Model200Response name(Integer name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getName() { + return name; + } + + + public void setName(Integer name) { + this.name = name; + } + + + public Model200Response propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPropertyClass() { + return propertyClass; + } + + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 000000000000..383cafdd3a5a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ModelApiResponse + */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) + +public class ModelApiResponse { + public static final String JSON_PROPERTY_CODE = "code"; + private Integer code; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + + public ModelApiResponse code(Integer code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCode() { + return code; + } + + + public void setCode(Integer code) { + this.code = code; + } + + + public ModelApiResponse type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public ModelApiResponse message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 000000000000..b62e13a90a0c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Model for testing reserved words + */ +@ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) + +public class ModelReturn { + public static final String JSON_PROPERTY_RETURN = "return"; + private Integer _return; + + + public ModelReturn _return(Integer _return) { + + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getReturn() { + return _return; + } + + + public void setReturn(Integer _return) { + this._return = _return; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 000000000000..bd625c5f66f3 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,177 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Model for testing model name same as property name + */ +@ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) + +public class Name { + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; + + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + private Integer snakeCase; + + public static final String JSON_PROPERTY_PROPERTY = "property"; + private String property; + + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + private Integer _123number; + + + public Name name(Integer name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getName() { + return name; + } + + + public void setName(Integer name) { + this.name = name; + } + + + /** + * Get snakeCase + * @return snakeCase + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSnakeCase() { + return snakeCase; + } + + + + + public Name property(String property) { + + this.property = property; + return this; + } + + /** + * Get property + * @return property + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getProperty() { + return property; + } + + + public void setProperty(String property) { + this.property = property; + } + + + /** + * Get _123number + * @return _123number + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer get123number() { + return _123number; + } + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 000000000000..6ade4828624e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,619 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NullableClass + */ +@JsonPropertyOrder({ + NullableClass.JSON_PROPERTY_INTEGER_PROP, + NullableClass.JSON_PROPERTY_NUMBER_PROP, + NullableClass.JSON_PROPERTY_BOOLEAN_PROP, + NullableClass.JSON_PROPERTY_STRING_PROP, + NullableClass.JSON_PROPERTY_DATE_PROP, + NullableClass.JSON_PROPERTY_DATETIME_PROP, + NullableClass.JSON_PROPERTY_ARRAY_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, + NullableClass.JSON_PROPERTY_OBJECT_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE +}) + +public class NullableClass extends HashMap { + public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; + private JsonNullable integerProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; + private JsonNullable numberProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; + private JsonNullable booleanProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; + private JsonNullable stringProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; + private JsonNullable dateProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; + private JsonNullable datetimeProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; + private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + private List arrayItemsNullable = null; + + public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + private JsonNullable> objectNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; + private JsonNullable> objectAndItemsNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + private Map objectItemsNullable = null; + + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + + return this; + } + + /** + * Get integerProp + * @return integerProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public Integer getIntegerProp() { + return integerProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getIntegerProp_JsonNullable() { + return integerProp; + } + + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + public void setIntegerProp_JsonNullable(JsonNullable integerProp) { + this.integerProp = integerProp; + } + + public void setIntegerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + } + + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public BigDecimal getNumberProp() { + return numberProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNumberProp_JsonNullable() { + return numberProp; + } + + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + public void setNumberProp_JsonNullable(JsonNullable numberProp) { + this.numberProp = numberProp; + } + + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + } + + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public Boolean getBooleanProp() { + return booleanProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getBooleanProp_JsonNullable() { + return booleanProp; + } + + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + public void setBooleanProp_JsonNullable(JsonNullable booleanProp) { + this.booleanProp = booleanProp; + } + + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + } + + + public NullableClass stringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public String getStringProp() { + return stringProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_STRING_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getStringProp_JsonNullable() { + return stringProp; + } + + @JsonProperty(JSON_PROPERTY_STRING_PROP) + public void setStringProp_JsonNullable(JsonNullable stringProp) { + this.stringProp = stringProp; + } + + public void setStringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + } + + + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public LocalDate getDateProp() { + return dateProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getDateProp_JsonNullable() { + return dateProp; + } + + @JsonProperty(JSON_PROPERTY_DATE_PROP) + public void setDateProp_JsonNullable(JsonNullable dateProp) { + this.dateProp = dateProp; + } + + public void setDateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + } + + + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public OffsetDateTime getDatetimeProp() { + return datetimeProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getDatetimeProp_JsonNullable() { + return datetimeProp; + } + + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + public void setDatetimeProp_JsonNullable(JsonNullable datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + } + + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) { + this.arrayNullableProp = JsonNullable.>of(new ArrayList<>()); + } + try { + this.arrayNullableProp.get().add(arrayNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public List getArrayNullableProp() { + return arrayNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getArrayNullableProp_JsonNullable() { + return arrayNullableProp; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + public void setArrayNullableProp_JsonNullable(JsonNullable> arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + } + + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) { + this.arrayAndItemsNullableProp = JsonNullable.>of(new ArrayList<>()); + } + try { + this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getArrayAndItemsNullableProp_JsonNullable() { + return arrayAndItemsNullableProp; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + public void setArrayAndItemsNullableProp_JsonNullable(JsonNullable> arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + } + + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.>of(objectNullableProp); + + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) { + this.objectNullableProp = JsonNullable.>of(new HashMap<>()); + } + try { + this.objectNullableProp.get().put(key, objectNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public Map getObjectNullableProp() { + return objectNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getObjectNullableProp_JsonNullable() { + return objectNullableProp; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + public void setObjectNullableProp_JsonNullable(JsonNullable> objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.>of(objectNullableProp); + } + + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); + + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) { + this.objectAndItemsNullableProp = JsonNullable.>of(new HashMap<>()); + } + try { + this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getObjectAndItemsNullableProp_JsonNullable() { + return objectAndItemsNullableProp; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + public void setObjectAndItemsNullableProp_JsonNullable(JsonNullable> objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); + } + + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return Objects.equals(this.integerProp, nullableClass.integerProp) && + Objects.equals(this.numberProp, nullableClass.numberProp) && + Objects.equals(this.booleanProp, nullableClass.booleanProp) && + Objects.equals(this.stringProp, nullableClass.stringProp) && + Objects.equals(this.dateProp, nullableClass.dateProp) && + Objects.equals(this.datetimeProp, nullableClass.datetimeProp) && + Objects.equals(this.arrayNullableProp, nullableClass.arrayNullableProp) && + Objects.equals(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) && + Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java new file mode 100644 index 000000000000..bdf4fc1dc388 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=NullableShape.NullableShapeDeserializer.class) +public class NullableShape extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(NullableShape.class.getName()); + + public static class NullableShapeDeserializer extends StdDeserializer { + public NullableShapeDeserializer() { + this(NullableShape.class); + } + + public NullableShapeDeserializer(Class vc) { + super(vc); + } + + @Override + public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize Quadrilateral + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); + } + + // deserialize Triangle + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); + } + + if (match == 1) { + NullableShape ret = new NullableShape(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for NullableShape: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public NullableShape() { + super("oneOf", Boolean.TRUE); + } + + public NullableShape(Quadrilateral o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + public NullableShape(Triangle o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + static { + schemas.put("Quadrilateral", new GenericType() { + }); + schemas.put("Triangle", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return NullableShape.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Quadrilateral) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Triangle) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); + } + + + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 000000000000..5ca72a169fe8 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NumberOnly + */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) + +public class NumberOnly { + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + private BigDecimal justNumber; + + + public NumberOnly justNumber(BigDecimal justNumber) { + + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getJustNumber() { + return justNumber; + } + + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 000000000000..ba4e395e94e9 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,295 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Order + */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) + +public class Order { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_PET_ID = "petId"; + private Long petId; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Integer quantity; + + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_COMPLETE = "complete"; + private Boolean complete = false; + + + public Order id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Order petId(Long petId) { + + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getPetId() { + return petId; + } + + + public void setPetId(Long petId) { + this.petId = petId; + } + + + public Order quantity(Integer quantity) { + + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getQuantity() { + return quantity; + } + + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + + public Order shipDate(OffsetDateTime shipDate) { + + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getShipDate() { + return shipDate; + } + + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + + public Order status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public Order complete(Boolean complete) { + + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getComplete() { + return complete; + } + + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 000000000000..d4d9ac6ba110 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * OuterComposite + */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) + +public class OuterComposite { + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + private BigDecimal myNumber; + + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + private String myString; + + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + private Boolean myBoolean; + + + public OuterComposite myNumber(BigDecimal myNumber) { + + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getMyNumber() { + return myNumber; + } + + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + + public OuterComposite myString(String myString) { + + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMyString() { + return myString; + } + + + public void setMyString(String myString) { + this.myString = myString; + } + + + public OuterComposite myBoolean(Boolean myBoolean) { + + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMyBoolean() { + return myBoolean; + } + + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 000000000000..d0c0bc3c9d20 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..7f6c2c73aa24 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 000000000000..c747a2e6daef --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..4f5fcd1cd95f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java new file mode 100644 index 000000000000..5b3dc1ffcaa0 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java @@ -0,0 +1,81 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ChildCat; +import org.openapitools.client.model.GrandparentAnimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ParentPet + */ +@JsonPropertyOrder({ +}) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "pet_type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"), +}) + +public class ParentPet extends GrandparentAnimal { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentPet {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 000000000000..2df466732f74 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,309 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Pet + */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) + +public class Pet { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private Category category; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + private List photoUrls = new ArrayList<>(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + + public Pet id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Pet category(Category category) { + + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Category getCategory() { + return category; + } + + + public void setCategory(Category category) { + this.category = category; + } + + + public Pet name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Pet photoUrls(List photoUrls) { + + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getPhotoUrls() { + return photoUrls; + } + + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + public Pet tags(List tags) { + + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTags() { + return tags; + } + + + public void setTags(List tags) { + this.tags = tags; + } + + + public Pet status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java new file mode 100644 index 000000000000..edf17c3ce78d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BasquePig; +import org.openapitools.client.model.DanishPig; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=Pig.PigDeserializer.class) +public class Pig extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Pig.class.getName()); + + public static class PigDeserializer extends StdDeserializer { + public PigDeserializer() { + this(Pig.class); + } + + public PigDeserializer(Class vc) { + super(vc); + } + + @Override + public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize BasquePig + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class); + match++; + log.log(Level.FINER, "Input data matches schema 'BasquePig'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'BasquePig'", e); + } + + // deserialize DanishPig + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class); + match++; + log.log(Level.FINER, "Input data matches schema 'DanishPig'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'DanishPig'", e); + } + + if (match == 1) { + Pig ret = new Pig(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for Pig: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public Pig() { + super("oneOf", Boolean.FALSE); + } + + public Pig(BasquePig o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Pig(DanishPig o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BasquePig", new GenericType() { + }); + schemas.put("DanishPig", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Pig.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BasquePig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DanishPig) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BasquePig, DanishPig"); + } + + + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java new file mode 100644 index 000000000000..a943d3b0db3a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ComplexQuadrilateral; +import org.openapitools.client.model.SimpleQuadrilateral; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=Quadrilateral.QuadrilateralDeserializer.class) +public class Quadrilateral extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Quadrilateral.class.getName()); + + public static class QuadrilateralDeserializer extends StdDeserializer { + public QuadrilateralDeserializer() { + this(Quadrilateral.class); + } + + public QuadrilateralDeserializer(Class vc) { + super(vc); + } + + @Override + public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize ComplexQuadrilateral + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); + match++; + log.log(Level.FINER, "Input data matches schema 'ComplexQuadrilateral'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ComplexQuadrilateral'", e); + } + + // deserialize SimpleQuadrilateral + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); + match++; + log.log(Level.FINER, "Input data matches schema 'SimpleQuadrilateral'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SimpleQuadrilateral'", e); + } + + if (match == 1) { + Quadrilateral ret = new Quadrilateral(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for Quadrilateral: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public Quadrilateral() { + super("oneOf", Boolean.FALSE); + } + + public Quadrilateral(ComplexQuadrilateral o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Quadrilateral(SimpleQuadrilateral o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ComplexQuadrilateral", new GenericType() { + }); + schemas.put("SimpleQuadrilateral", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Quadrilateral.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ComplexQuadrilateral) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SimpleQuadrilateral) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ComplexQuadrilateral, SimpleQuadrilateral"); + } + + + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java new file mode 100644 index 000000000000..7a586c4ca775 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * QuadrilateralInterface + */ +@JsonPropertyOrder({ + QuadrilateralInterface.JSON_PROPERTY_QUADRILATERAL_TYPE +}) + +public class QuadrilateralInterface { + public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + private String quadrilateralType; + + + public QuadrilateralInterface quadrilateralType(String quadrilateralType) { + + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * @return quadrilateralType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getQuadrilateralType() { + return quadrilateralType; + } + + + public void setQuadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuadrilateralInterface quadrilateralInterface = (QuadrilateralInterface) o; + return Objects.equals(this.quadrilateralType, quadrilateralInterface.quadrilateralType); + } + + @Override + public int hashCode() { + return Objects.hash(quadrilateralType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuadrilateralInterface {\n"); + sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..b3e58ef3d2c5 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,124 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ReadOnlyFirst + */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) + +public class ReadOnlyFirst { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; + + public static final String JSON_PROPERTY_BAZ = "baz"; + private String baz; + + + /** + * Get bar + * @return bar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + + + public ReadOnlyFirst baz(String baz) { + + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBaz() { + return baz; + } + + + public void setBaz(String baz) { + this.baz = baz; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java new file mode 100644 index 000000000000..b8f6d9955d57 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ScaleneTriangle + */ +@JsonPropertyOrder({ + ScaleneTriangle.JSON_PROPERTY_SHAPE_TYPE, + ScaleneTriangle.JSON_PROPERTY_TRIANGLE_TYPE +}) + +public class ScaleneTriangle { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; + + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + private String triangleType; + + + public ScaleneTriangle shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + public ScaleneTriangle triangleType(String triangleType) { + + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTriangleType() { + return triangleType; + } + + + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o; + return Objects.equals(this.shapeType, scaleneTriangle.shapeType) && + Objects.equals(this.triangleType, scaleneTriangle.triangleType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, triangleType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScaleneTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java new file mode 100644 index 000000000000..b97481242e5d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=Shape.ShapeDeserializer.class) +public class Shape extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Shape.class.getName()); + + public static class ShapeDeserializer extends StdDeserializer { + public ShapeDeserializer() { + this(Shape.class); + } + + public ShapeDeserializer(Class vc) { + super(vc); + } + + @Override + public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize Quadrilateral + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); + } + + // deserialize Triangle + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); + } + + if (match == 1) { + Shape ret = new Shape(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for Shape: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public Shape() { + super("oneOf", Boolean.FALSE); + } + + public Shape(Quadrilateral o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Shape(Triangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Quadrilateral", new GenericType() { + }); + schemas.put("Triangle", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Shape.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Quadrilateral) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Triangle) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); + } + + + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java new file mode 100644 index 000000000000..2b4cf2193066 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ShapeInterface + */ +@JsonPropertyOrder({ + ShapeInterface.JSON_PROPERTY_SHAPE_TYPE +}) + +public class ShapeInterface { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; + + + public ShapeInterface shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ShapeInterface shapeInterface = (ShapeInterface) o; + return Objects.equals(this.shapeType, shapeInterface.shapeType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ShapeInterface {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java new file mode 100644 index 000000000000..6a47a10de5f0 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=ShapeOrNull.ShapeOrNullDeserializer.class) +public class ShapeOrNull extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ShapeOrNull.class.getName()); + + public static class ShapeOrNullDeserializer extends StdDeserializer { + public ShapeOrNullDeserializer() { + this(ShapeOrNull.class); + } + + public ShapeOrNullDeserializer(Class vc) { + super(vc); + } + + @Override + public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize Quadrilateral + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); + } + + // deserialize Triangle + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); + } + + if (match == 1) { + ShapeOrNull ret = new ShapeOrNull(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for ShapeOrNull: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public ShapeOrNull() { + super("oneOf", Boolean.TRUE); + } + + public ShapeOrNull(Quadrilateral o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + public ShapeOrNull(Triangle o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + static { + schemas.put("Quadrilateral", new GenericType() { + }); + schemas.put("Triangle", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return ShapeOrNull.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Quadrilateral) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Triangle) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); + } + + + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java new file mode 100644 index 000000000000..0ad65aa09dd6 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.QuadrilateralInterface; +import org.openapitools.client.model.ShapeInterface; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SimpleQuadrilateral + */ +@JsonPropertyOrder({ + SimpleQuadrilateral.JSON_PROPERTY_SHAPE_TYPE, + SimpleQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE +}) + +public class SimpleQuadrilateral { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; + + public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + private String quadrilateralType; + + + public SimpleQuadrilateral shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + public SimpleQuadrilateral quadrilateralType(String quadrilateralType) { + + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * @return quadrilateralType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getQuadrilateralType() { + return quadrilateralType; + } + + + public void setQuadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o; + return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) && + Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, quadrilateralType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SimpleQuadrilateral {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 000000000000..b588ef95226b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SpecialModelName + */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) + +public class SpecialModelName { + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + private Long $specialPropertyName; + + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + + this.$specialPropertyName = $specialPropertyName; + return this; + } + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 000000000000..a3ecb398faa3 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Tag + */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) + +public class Tag { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + + public Tag id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Tag name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java new file mode 100644 index 000000000000..0db61e7c1601 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.EquilateralTriangle; +import org.openapitools.client.model.IsoscelesTriangle; +import org.openapitools.client.model.ScaleneTriangle; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=Triangle.TriangleDeserializer.class) +public class Triangle extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Triangle.class.getName()); + + public static class TriangleDeserializer extends StdDeserializer { + public TriangleDeserializer() { + this(Triangle.class); + } + + public TriangleDeserializer(Class vc) { + super(vc); + } + + @Override + public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize EquilateralTriangle + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); + match++; + log.log(Level.FINER, "Input data matches schema 'EquilateralTriangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'EquilateralTriangle'", e); + } + + // deserialize IsoscelesTriangle + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); + match++; + log.log(Level.FINER, "Input data matches schema 'IsoscelesTriangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IsoscelesTriangle'", e); + } + + // deserialize ScaleneTriangle + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class); + match++; + log.log(Level.FINER, "Input data matches schema 'ScaleneTriangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ScaleneTriangle'", e); + } + + if (match == 1) { + Triangle ret = new Triangle(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for Triangle: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public Triangle() { + super("oneOf", Boolean.FALSE); + } + + public Triangle(EquilateralTriangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Triangle(IsoscelesTriangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Triangle(ScaleneTriangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("EquilateralTriangle", new GenericType() { + }); + schemas.put("IsoscelesTriangle", new GenericType() { + }); + schemas.put("ScaleneTriangle", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Triangle.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof EquilateralTriangle) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof IsoscelesTriangle) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ScaleneTriangle) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + } + + + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java new file mode 100644 index 000000000000..5064ab5e3e6a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TriangleInterface + */ +@JsonPropertyOrder({ + TriangleInterface.JSON_PROPERTY_TRIANGLE_TYPE +}) + +public class TriangleInterface { + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + private String triangleType; + + + public TriangleInterface triangleType(String triangleType) { + + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTriangleType() { + return triangleType; + } + + + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriangleInterface triangleInterface = (TriangleInterface) o; + return Objects.equals(this.triangleType, triangleInterface.triangleType); + } + + @Override + public int hashCode() { + return Objects.hash(triangleType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriangleInterface {\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 000000000000..570d1ace3ff4 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,476 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * User + */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS, + User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, + User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, + User.JSON_PROPERTY_ANY_TYPE_PROP, + User.JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE +}) + +public class User { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_PHONE = "phone"; + private String phone; + + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + private Integer userStatus; + + public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; + private Object objectWithNoDeclaredProps; + + public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; + private JsonNullable objectWithNoDeclaredPropsNullable = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ANY_TYPE_PROP = "anyTypeProp"; + private JsonNullable anyTypeProp = JsonNullable.of(null); + + public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; + private JsonNullable anyTypePropNullable = JsonNullable.of(null); + + + public User id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public User username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public User firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFirstName() { + return firstName; + } + + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public User lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLastName() { + return lastName; + } + + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public User email(String email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public User password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public User phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPhone() { + return phone; + } + + + public void setPhone(String phone) { + this.phone = phone; + } + + + public User userStatus(Integer userStatus) { + + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUserStatus() { + return userStatus; + } + + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + public User objectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { + + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + return this; + } + + /** + * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + * @return objectWithNoDeclaredProps + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.") + @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getObjectWithNoDeclaredProps() { + return objectWithNoDeclaredProps; + } + + + public void setObjectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + } + + + public User objectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = JsonNullable.of(objectWithNoDeclaredPropsNullable); + + return this; + } + + /** + * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + * @return objectWithNoDeclaredPropsNullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.") + @JsonIgnore + + public Object getObjectWithNoDeclaredPropsNullable() { + return objectWithNoDeclaredPropsNullable.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getObjectWithNoDeclaredPropsNullable_JsonNullable() { + return objectWithNoDeclaredPropsNullable; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) + public void setObjectWithNoDeclaredPropsNullable_JsonNullable(JsonNullable objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + } + + public void setObjectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = JsonNullable.of(objectWithNoDeclaredPropsNullable); + } + + + public User anyTypeProp(Object anyTypeProp) { + this.anyTypeProp = JsonNullable.of(anyTypeProp); + + return this; + } + + /** + * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + * @return anyTypeProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389") + @JsonIgnore + + public Object getAnyTypeProp() { + return anyTypeProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAnyTypeProp_JsonNullable() { + return anyTypeProp; + } + + @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP) + public void setAnyTypeProp_JsonNullable(JsonNullable anyTypeProp) { + this.anyTypeProp = anyTypeProp; + } + + public void setAnyTypeProp(Object anyTypeProp) { + this.anyTypeProp = JsonNullable.of(anyTypeProp); + } + + + public User anyTypePropNullable(Object anyTypePropNullable) { + this.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); + + return this; + } + + /** + * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + * @return anyTypePropNullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.") + @JsonIgnore + + public Object getAnyTypePropNullable() { + return anyTypePropNullable.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAnyTypePropNullable_JsonNullable() { + return anyTypePropNullable; + } + + @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE) + public void setAnyTypePropNullable_JsonNullable(JsonNullable anyTypePropNullable) { + this.anyTypePropNullable = anyTypePropNullable; + } + + public void setAnyTypePropNullable(Object anyTypePropNullable) { + this.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus) && + Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) && + Objects.equals(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) && + Objects.equals(this.anyTypeProp, user.anyTypeProp) && + Objects.equals(this.anyTypePropNullable, user.anyTypePropNullable); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, objectWithNoDeclaredPropsNullable, anyTypeProp, anyTypePropNullable); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append(" objectWithNoDeclaredProps: ").append(toIndentedString(objectWithNoDeclaredProps)).append("\n"); + sb.append(" objectWithNoDeclaredPropsNullable: ").append(toIndentedString(objectWithNoDeclaredPropsNullable)).append("\n"); + sb.append(" anyTypeProp: ").append(toIndentedString(anyTypeProp)).append("\n"); + sb.append(" anyTypePropNullable: ").append(toIndentedString(anyTypePropNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java new file mode 100644 index 000000000000..64c82e711aca --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java @@ -0,0 +1,163 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Whale + */ +@JsonPropertyOrder({ + Whale.JSON_PROPERTY_HAS_BALEEN, + Whale.JSON_PROPERTY_HAS_TEETH, + Whale.JSON_PROPERTY_CLASS_NAME +}) + +public class Whale { + public static final String JSON_PROPERTY_HAS_BALEEN = "hasBaleen"; + private Boolean hasBaleen; + + public static final String JSON_PROPERTY_HAS_TEETH = "hasTeeth"; + private Boolean hasTeeth; + + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; + + + public Whale hasBaleen(Boolean hasBaleen) { + + this.hasBaleen = hasBaleen; + return this; + } + + /** + * Get hasBaleen + * @return hasBaleen + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_HAS_BALEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHasBaleen() { + return hasBaleen; + } + + + public void setHasBaleen(Boolean hasBaleen) { + this.hasBaleen = hasBaleen; + } + + + public Whale hasTeeth(Boolean hasTeeth) { + + this.hasTeeth = hasTeeth; + return this; + } + + /** + * Get hasTeeth + * @return hasTeeth + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_HAS_TEETH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHasTeeth() { + return hasTeeth; + } + + + public void setHasTeeth(Boolean hasTeeth) { + this.hasTeeth = hasTeeth; + } + + + public Whale className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Whale whale = (Whale) o; + return Objects.equals(this.hasBaleen, whale.hasBaleen) && + Objects.equals(this.hasTeeth, whale.hasTeeth) && + Objects.equals(this.className, whale.className); + } + + @Override + public int hashCode() { + return Objects.hash(hasBaleen, hasTeeth, className); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Whale {\n"); + sb.append(" hasBaleen: ").append(toIndentedString(hasBaleen)).append("\n"); + sb.append(" hasTeeth: ").append(toIndentedString(hasTeeth)).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java new file mode 100644 index 000000000000..84436cf0de92 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java @@ -0,0 +1,173 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Zebra + */ +@JsonPropertyOrder({ + Zebra.JSON_PROPERTY_TYPE, + Zebra.JSON_PROPERTY_CLASS_NAME +}) + +public class Zebra extends HashMap { + /** + * Gets or Sets type + */ + public enum TypeEnum { + PLAINS("plains"), + + MOUNTAIN("mountain"), + + GREVYS("grevys"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; + + + public Zebra type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public Zebra className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Zebra zebra = (Zebra) o; + return Objects.equals(this.type, zebra.type) && + Objects.equals(this.className, zebra.className) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, className, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Zebra {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java new file mode 100644 index 000000000000..89227f3d252c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java @@ -0,0 +1,68 @@ +package org.openapitools.client; + +import org.openapitools.client.model.Mammal; +import org.openapitools.client.model.AppleReq; +import org.openapitools.client.model.BananaReq; +import org.openapitools.client.model.FruitReq; +import org.openapitools.client.model.BasquePig; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; +import java.lang.Exception; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class JSONComposedSchemaTest { + JSON json = null; + Mammal mammal = null; + + @Before + public void setup() { + json = new JSON(); + mammal = new Mammal(); + } + + /** + * Validate a oneOf schema can be deserialized into the expected class. + * The oneOf schema does not have a discriminator. + */ + @Test + public void testOneOfSchemaWithoutDiscriminator() throws Exception { + // BananaReq and AppleReq have explicitly defined properties that are different by name. + // There is no discriminator property. + String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false }"; + FruitReq o = json.getContext(null).readValue(str, FruitReq.class); + assertTrue(o.getActualInstance() instanceof AppleReq); + } + + /** + * Validate a oneOf schema can be deserialized into the expected class. + * The oneOf schema has a discriminator. + */ + @Test + public void testOneOfSchemaWithDiscriminator() throws Exception { + // Mammal can be one of whale, pig and zebra. + // pig has sub-classes. + String str = "{ \"className\": \"whale\", \"hasBaleen\": true, \"hasTeeth\": false }"; + /* + DISABLING unit test for now until ambiguity of discriminator is resolved. + + // Note that the 'zebra' schema does not have any explicit property defined AND + // it has additionalProperties: true. Hence without a discriminator the above + // JSON payload would match both 'whale' and 'zebra'. This is because the 'hasBaleen' + // and 'hasTeeth' would be considered additional (undeclared) properties for 'zebra'. + Mammal o = json.getContext(null).readValue(str, Mammal.class); + assertTrue(o.getActualInstance() instanceof Whale); + + str = "{ \"className\": \"zebra\" }"; + o = json.getContext(null).readValue(str, Mammal.class); + assertTrue(o.getActualInstance() instanceof Zebra); + + str = "{ \"className\": \"BasquePig\" }"; + o = json.getContext(null).readValue(str, Mammal.class); + assertTrue(o.getActualInstance() instanceof BasquePig); + */ + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java new file mode 100644 index 000000000000..7fb307a3df8d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java @@ -0,0 +1,45 @@ +package org.openapitools.client; + +import org.openapitools.client.model.Order; + +import java.lang.Exception; + +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import org.junit.*; +import static org.junit.Assert.*; + + +public class JSONTest { + JSON json = null; + Order order = null; + + @Before + public void setup() { + json = new JSON(); + order = new Order(); + } + + @Test + public void testDefaultDate() throws Exception { + final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + final String dateStr = "2015-11-07T14:11:05.267Z"; + order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from)); + + String str = json.getContext(null).writeValueAsString(order); + Order o = json.getContext(null).readValue(str, Order.class); + assertEquals(dateStr, dateFormat.format(o.getShipDate())); + } + + @Test + public void testCustomDate() throws Exception { + final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); + final String dateStr = "2015-11-07T14:11:05-02:00"; + order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from)); + + String str = json.getContext(null).writeValueAsString(order); + Order o = json.getContext(null).readValue(str, Order.class); + assertEquals(dateStr, dateFormat.format(o.getShipDate())); + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 000000000000..24df57d8d7eb --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; +import org.junit.Assert; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() throws ApiException { + //Client client = null; + //Client response = api.call123testSpecialTags(client); + // TODO: test validations + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 000000000000..3f6b4c2d7160 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.InlineResponseDefault; +import org.junit.Test; +import org.junit.Ignore; +import org.junit.Assert; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fooGetTest() throws ApiException { + //InlineResponseDefault response = api.fooGet(); + // TODO: test validations + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 000000000000..b46f1ae7b267 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,290 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.User; +import org.junit.Test; +import org.junit.Ignore; +import org.junit.Assert; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FakeApi + */ +public class FakeApiTest { + + private final FakeApi api = new FakeApi(); + + /** + * Health check endpoint + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHealthGetTest() throws ApiException { + //HealthCheckResult response = api.fakeHealthGet(); + // TODO: test validations + } + + /** + * + * + * Test serialization of outer boolean types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws ApiException { + //Boolean body = null; + //Boolean response = api.fakeOuterBooleanSerialize(body); + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws ApiException { + //OuterComposite outerComposite = null; + //OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws ApiException { + //BigDecimal body = null; + //BigDecimal response = api.fakeOuterNumberSerialize(body); + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws ApiException { + //String body = null; + //String response = api.fakeOuterStringSerialize(body); + // TODO: test validations + } + + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() throws ApiException { + //FileSchemaTestClass fileSchemaTestClass = null; + //api.testBodyWithFileSchema(fileSchemaTestClass); + // TODO: test validations + } + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + //String query = null; + //User user = null; + //api.testBodyWithQueryParams(query, user); + // TODO: test validations + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() throws ApiException { + //Client client = null; + //Client response = api.testClientModel(client); + // TODO: test validations + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() throws ApiException { + //BigDecimal number = null; + //Double _double = null; + //String patternWithoutDelimiter = null; + //byte[] _byte = null; + //Integer integer = null; + //Integer int32 = null; + //Long int64 = null; + //Float _float = null; + //String string = null; + //File binary = null; + //LocalDate date = null; + //OffsetDateTime dateTime = null; + //String password = null; + //String paramCallback = null; + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() throws ApiException { + //List enumHeaderStringArray = null; + //String enumHeaderString = null; + //List enumQueryStringArray = null; + //String enumQueryString = null; + //Integer enumQueryInteger = null; + //Double enumQueryDouble = null; + //List enumFormStringArray = null; + //String enumFormString = null; + //api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + // TODO: test validations + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() throws ApiException { + //Integer requiredStringGroup = null; + //Boolean requiredBooleanGroup = null; + //Long requiredInt64Group = null; + //Integer stringGroup = null; + //Boolean booleanGroup = null; + //Long int64Group = null; + //api.testGroupParameters() + // .requiredStringGroup(requiredStringGroup) + // .requiredBooleanGroup(requiredBooleanGroup) + // .requiredInt64Group(requiredInt64Group) + // .stringGroup(stringGroup) + // .booleanGroup(booleanGroup) + // .int64Group(int64Group) + // .execute(); + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws ApiException { + //Map requestBody = null; + //api.testInlineAdditionalProperties(requestBody); + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws ApiException { + //String param = null; + //String param2 = null; + //api.testJsonFormData(param, param2); + // TODO: test validations + } + + /** + * + * + * To test the collection format in query parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() throws ApiException { + //List pipe = null; + //List ioutil = null; + //List http = null; + //List url = null; + //List context = null; + //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // TODO: test validations + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 000000000000..2194d1682951 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; +import org.junit.Assert; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FakeClassnameTags123Api + */ +public class FakeClassnameTags123ApiTest { + + private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); + + /** + * To test class name in snake case + * + * To test class name in snake case + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClassnameTest() throws ApiException { + //Client client = null; + //Client response = api.testClassname(client); + // TODO: test validations + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 000000000000..866d46d816dc --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,179 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import org.junit.Test; +import org.junit.Ignore; +import org.junit.Assert; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for PetApi + */ +public class PetApiTest { + + private final PetApi api = new PetApi(); + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void addPetTest() throws ApiException { + //Pet pet = null; + //api.addPet(pet); + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePetTest() throws ApiException { + //Long petId = null; + //String apiKey = null; + //api.deletePet(petId, apiKey); + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByStatusTest() throws ApiException { + //List status = null; + //List response = api.findPetsByStatus(status); + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByTagsTest() throws ApiException { + //List tags = null; + //List response = api.findPetsByTags(tags); + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() throws ApiException { + //Long petId = null; + //Pet response = api.getPetById(petId); + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() throws ApiException { + //Pet pet = null; + //api.updatePet(pet); + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetWithFormTest() throws ApiException { + //Long petId = null; + //String name = null; + //String status = null; + //api.updatePetWithForm(petId, name, status); + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() throws ApiException { + //Long petId = null; + //String additionalMetadata = null; + //File file = null; + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + // TODO: test validations + } + + /** + * uploads an image (required) + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileWithRequiredFileTest() throws ApiException { + //Long petId = null; + //File requiredFile = null; + //String additionalMetadata = null; + //ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + // TODO: test validations + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 000000000000..20dcc8c1d6e5 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.Order; +import org.junit.Test; +import org.junit.Ignore; +import org.junit.Assert; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for StoreApi + */ +public class StoreApiTest { + + private final StoreApi api = new StoreApi(); + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteOrderTest() throws ApiException { + //String orderId = null; + //api.deleteOrder(orderId); + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getInventoryTest() throws ApiException { + //Map response = api.getInventory(); + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getOrderByIdTest() throws ApiException { + //Long orderId = null; + //Order response = api.getOrderById(orderId); + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void placeOrderTest() throws ApiException { + //Order order = null; + //Order response = api.placeOrder(order); + // TODO: test validations + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 000000000000..17c07ffe226f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.User; +import org.junit.Test; +import org.junit.Ignore; +import org.junit.Assert; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for UserApi + */ +public class UserApiTest { + + private final UserApi api = new UserApi(); + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUserTest() throws ApiException { + //User user = null; + //api.createUser(user); + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() throws ApiException { + //List user = null; + //api.createUsersWithArrayInput(user); + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithListInputTest() throws ApiException { + //List user = null; + //api.createUsersWithListInput(user); + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteUserTest() throws ApiException { + //String username = null; + //api.deleteUser(username); + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getUserByNameTest() throws ApiException { + //String username = null; + //User response = api.getUserByName(username); + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() throws ApiException { + //String username = null; + //String password = null; + //String response = api.loginUser(username, password); + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() throws ApiException { + //api.logoutUser(); + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + //String username = null; + //User user = null; + //api.updateUser(username, user); + // TODO: test validations + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..88ee16219b0a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesClass + */ +public class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + public void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + public void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + + /** + * Test the property 'anytype1' + */ + @Test + public void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype1' + */ + @Test + public void mapWithUndeclaredPropertiesAnytype1Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype1 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype2' + */ + @Test + public void mapWithUndeclaredPropertiesAnytype2Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype2 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype3' + */ + @Test + public void mapWithUndeclaredPropertiesAnytype3Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype3 + } + + /** + * Test the property 'emptyMap' + */ + @Test + public void emptyMapTest() { + // TODO: test emptyMap + } + + /** + * Test the property 'mapWithUndeclaredPropertiesString' + */ + @Test + public void mapWithUndeclaredPropertiesStringTest() { + // TODO: test mapWithUndeclaredPropertiesString + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 000000000000..558153c5578a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Cat; +import org.openapitools.client.model.Dog; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Animal + */ +public class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + public void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AppleReqTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AppleReqTest.java new file mode 100644 index 000000000000..0f39f3ad75cf --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AppleReqTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AppleReq + */ +public class AppleReqTest { + private final AppleReq model = new AppleReq(); + + /** + * Model tests for AppleReq + */ + @Test + public void testAppleReq() { + // TODO: test AppleReq + } + + /** + * Test the property 'cultivar' + */ + @Test + public void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'mealy' + */ + @Test + public void mealyTest() { + // TODO: test mealy + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AppleTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AppleTest.java new file mode 100644 index 000000000000..d983478a130b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/AppleTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Apple + */ +public class AppleTest { + private final Apple model = new Apple(); + + /** + * Model tests for Apple + */ + @Test + public void testApple() { + // TODO: test Apple + } + + /** + * Test the property 'cultivar' + */ + @Test + public void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..e25187a3b608 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +public class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..ae1061823991 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayOfNumberOnly + */ +public class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 000000000000..36bd9951cf60 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayTest + */ +public class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BananaReqTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BananaReqTest.java new file mode 100644 index 000000000000..a6d9b0c6123d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BananaReqTest.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BananaReq + */ +public class BananaReqTest { + private final BananaReq model = new BananaReq(); + + /** + * Model tests for BananaReq + */ + @Test + public void testBananaReq() { + // TODO: test BananaReq + } + + /** + * Test the property 'lengthCm' + */ + @Test + public void lengthCmTest() { + // TODO: test lengthCm + } + + /** + * Test the property 'sweet' + */ + @Test + public void sweetTest() { + // TODO: test sweet + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BananaTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BananaTest.java new file mode 100644 index 000000000000..ce5b24ce27f9 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BananaTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Banana + */ +public class BananaTest { + private final Banana model = new Banana(); + + /** + * Model tests for Banana + */ + @Test + public void testBanana() { + // TODO: test Banana + } + + /** + * Test the property 'lengthCm' + */ + @Test + public void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BasquePigTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BasquePigTest.java new file mode 100644 index 000000000000..c89b20084dfa --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BasquePigTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BasquePig + */ +public class BasquePigTest { + private final BasquePig model = new BasquePig(); + + /** + * Model tests for BasquePig + */ + @Test + public void testBasquePig() { + // TODO: test BasquePig + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 000000000000..a701b341fc59 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Capitalization + */ +public class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CatAllOfTest.java new file mode 100644 index 000000000000..1d85a0447253 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for CatAllOf + */ +public class CatAllOfTest { + private final CatAllOf model = new CatAllOf(); + + /** + * Model tests for CatAllOf + */ + @Test + public void testCatAllOf() { + // TODO: test CatAllOf + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 000000000000..1792dc3cc76a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.CatAllOf; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Cat + */ +public class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + public void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 000000000000..6027994a2ac3 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ChildCatAllOfTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ChildCatAllOfTest.java new file mode 100644 index 000000000000..23ba3a5e47cd --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ChildCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ChildCatAllOf + */ +public class ChildCatAllOfTest { + private final ChildCatAllOf model = new ChildCatAllOf(); + + /** + * Model tests for ChildCatAllOf + */ + @Test + public void testChildCatAllOf() { + // TODO: test ChildCatAllOf + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ChildCatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ChildCatTest.java new file mode 100644 index 000000000000..4e71ac70188f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ChildCatTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ChildCatAllOf; +import org.openapitools.client.model.ParentPet; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ChildCat + */ +public class ChildCatTest { + private final ChildCat model = new ChildCat(); + + /** + * Model tests for ChildCat + */ + @Test + public void testChildCat() { + // TODO: test ChildCat + } + + /** + * Test the property 'petType' + */ + @Test + public void petTypeTest() { + // TODO: test petType + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 000000000000..8914c9cad43d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ClassModel + */ +public class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 000000000000..c21b346272d7 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Client + */ +public class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + public void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java new file mode 100644 index 000000000000..6237f87cb9b6 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.QuadrilateralInterface; +import org.openapitools.client.model.ShapeInterface; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ComplexQuadrilateral + */ +public class ComplexQuadrilateralTest { + private final ComplexQuadrilateral model = new ComplexQuadrilateral(); + + /** + * Model tests for ComplexQuadrilateral + */ + @Test + public void testComplexQuadrilateral() { + // TODO: test ComplexQuadrilateral + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DanishPigTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DanishPigTest.java new file mode 100644 index 000000000000..9d2b8aeaa0bf --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DanishPigTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for DanishPig + */ +public class DanishPigTest { + private final DanishPig model = new DanishPig(); + + /** + * Model tests for DanishPig + */ + @Test + public void testDanishPig() { + // TODO: test DanishPig + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DogAllOfTest.java new file mode 100644 index 000000000000..6e4b49108098 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for DogAllOf + */ +public class DogAllOfTest { + private final DogAllOf model = new DogAllOf(); + + /** + * Model tests for DogAllOf + */ + @Test + public void testDogAllOf() { + // TODO: test DogAllOf + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DogTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 000000000000..3446815a300a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.DogAllOf; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Dog + */ +public class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + public void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DrawingTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DrawingTest.java new file mode 100644 index 000000000000..406cad75e14f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/DrawingTest.java @@ -0,0 +1,84 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.Fruit; +import org.openapitools.client.model.NullableShape; +import org.openapitools.client.model.Shape; +import org.openapitools.client.model.ShapeOrNull; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Drawing + */ +public class DrawingTest { + private final Drawing model = new Drawing(); + + /** + * Model tests for Drawing + */ + @Test + public void testDrawing() { + // TODO: test Drawing + } + + /** + * Test the property 'mainShape' + */ + @Test + public void mainShapeTest() { + // TODO: test mainShape + } + + /** + * Test the property 'shapeOrNull' + */ + @Test + public void shapeOrNullTest() { + // TODO: test shapeOrNull + } + + /** + * Test the property 'nullableShape' + */ + @Test + public void nullableShapeTest() { + // TODO: test nullableShape + } + + /** + * Test the property 'shapes' + */ + @Test + public void shapesTest() { + // TODO: test shapes + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 000000000000..45b8fbbd8220 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumArrays + */ +public class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 000000000000..9e45543facd2 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumClass + */ +public class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 000000000000..936fbe191c01 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumTest + */ +public class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + public void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + public void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + public void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + public void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java new file mode 100644 index 000000000000..66a6d32e76f7 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EquilateralTriangle + */ +public class EquilateralTriangleTest { + private final EquilateralTriangle model = new EquilateralTriangle(); + + /** + * Model tests for EquilateralTriangle + */ + @Test + public void testEquilateralTriangle() { + // TODO: test EquilateralTriangle + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..ef37e666be39 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for FileSchemaTestClass + */ +public class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property 'file' + */ + @Test + public void fileTest() { + // TODO: test file + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FooTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 000000000000..e315d9e3b155 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Foo + */ +public class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + public void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 000000000000..d282af3ac23b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,166 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for FormatTest + */ +public class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + public void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + public void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FruitReqTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FruitReqTest.java new file mode 100644 index 000000000000..dc614b817d83 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FruitReqTest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.openapitools.client.model.AppleReq; +import org.openapitools.client.model.BananaReq; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for FruitReq + */ +public class FruitReqTest { + private final FruitReq model = new FruitReq(); + + /** + * Model tests for FruitReq + */ + @Test + public void testFruitReq() { + // TODO: test FruitReq + } + + /** + * Test the property 'cultivar' + */ + @Test + public void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'mealy' + */ + @Test + public void mealyTest() { + // TODO: test mealy + } + + /** + * Test the property 'lengthCm' + */ + @Test + public void lengthCmTest() { + // TODO: test lengthCm + } + + /** + * Test the property 'sweet' + */ + @Test + public void sweetTest() { + // TODO: test sweet + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FruitTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FruitTest.java new file mode 100644 index 000000000000..36dee4f05ba7 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/FruitTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Fruit + */ +public class FruitTest { + private final Fruit model = new Fruit(); + + /** + * Model tests for Fruit + */ + @Test + public void testFruit() { + // TODO: test Fruit + } + + /** + * Test the property 'cultivar' + */ + @Test + public void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + public void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/GmFruitTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/GmFruitTest.java new file mode 100644 index 000000000000..ed3965cd8a06 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/GmFruitTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for GmFruit + */ +public class GmFruitTest { + private final GmFruit model = new GmFruit(); + + /** + * Model tests for GmFruit + */ + @Test + public void testGmFruit() { + // TODO: test GmFruit + } + + /** + * Test the property 'cultivar' + */ + @Test + public void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + public void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java new file mode 100644 index 000000000000..59aba05da2db --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ChildCat; +import org.openapitools.client.model.ParentPet; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for GrandparentAnimal + */ +public class GrandparentAnimalTest { + private final GrandparentAnimal model = new GrandparentAnimal(); + + /** + * Model tests for GrandparentAnimal + */ + @Test + public void testGrandparentAnimal() { + // TODO: test GrandparentAnimal + } + + /** + * Test the property 'petType' + */ + @Test + public void petTypeTest() { + // TODO: test petType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..e902c100383b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for HasOnlyReadOnly + */ +public class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + public void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 000000000000..43806e73f933 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for HealthCheckResult + */ +public class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + public void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + public void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject1Test.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject1Test.java new file mode 100644 index 000000000000..f7e7347374d3 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject1Test.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for InlineObject1 + */ +public class InlineObject1Test { + private final InlineObject1 model = new InlineObject1(); + + /** + * Model tests for InlineObject1 + */ + @Test + public void testInlineObject1() { + // TODO: test InlineObject1 + } + + /** + * Test the property 'additionalMetadata' + */ + @Test + public void additionalMetadataTest() { + // TODO: test additionalMetadata + } + + /** + * Test the property 'file' + */ + @Test + public void fileTest() { + // TODO: test file + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject2Test.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject2Test.java new file mode 100644 index 000000000000..a25872427e3d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject2Test.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for InlineObject2 + */ +public class InlineObject2Test { + private final InlineObject2 model = new InlineObject2(); + + /** + * Model tests for InlineObject2 + */ + @Test + public void testInlineObject2() { + // TODO: test InlineObject2 + } + + /** + * Test the property 'enumFormStringArray' + */ + @Test + public void enumFormStringArrayTest() { + // TODO: test enumFormStringArray + } + + /** + * Test the property 'enumFormString' + */ + @Test + public void enumFormStringTest() { + // TODO: test enumFormString + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject3Test.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject3Test.java new file mode 100644 index 000000000000..66d973213517 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject3Test.java @@ -0,0 +1,157 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for InlineObject3 + */ +public class InlineObject3Test { + private final InlineObject3 model = new InlineObject3(); + + /** + * Model tests for InlineObject3 + */ + @Test + public void testInlineObject3() { + // TODO: test InlineObject3 + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property 'patternWithoutDelimiter' + */ + @Test + public void patternWithoutDelimiterTest() { + // TODO: test patternWithoutDelimiter + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'callback' + */ + @Test + public void callbackTest() { + // TODO: test callback + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject4Test.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject4Test.java new file mode 100644 index 000000000000..dee98299577f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject4Test.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for InlineObject4 + */ +public class InlineObject4Test { + private final InlineObject4 model = new InlineObject4(); + + /** + * Model tests for InlineObject4 + */ + @Test + public void testInlineObject4() { + // TODO: test InlineObject4 + } + + /** + * Test the property 'param' + */ + @Test + public void paramTest() { + // TODO: test param + } + + /** + * Test the property 'param2' + */ + @Test + public void param2Test() { + // TODO: test param2 + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject5Test.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject5Test.java new file mode 100644 index 000000000000..bca9d9d5532f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObject5Test.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for InlineObject5 + */ +public class InlineObject5Test { + private final InlineObject5 model = new InlineObject5(); + + /** + * Model tests for InlineObject5 + */ + @Test + public void testInlineObject5() { + // TODO: test InlineObject5 + } + + /** + * Test the property 'additionalMetadata' + */ + @Test + public void additionalMetadataTest() { + // TODO: test additionalMetadata + } + + /** + * Test the property 'requiredFile' + */ + @Test + public void requiredFileTest() { + // TODO: test requiredFile + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObjectTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObjectTest.java new file mode 100644 index 000000000000..eac0e1987dce --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineObjectTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for InlineObject + */ +public class InlineObjectTest { + private final InlineObject model = new InlineObject(); + + /** + * Model tests for InlineObject + */ + @Test + public void testInlineObject() { + // TODO: test InlineObject + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java new file mode 100644 index 000000000000..dc7262e10b10 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Foo; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for InlineResponseDefault + */ +public class InlineResponseDefaultTest { + private final InlineResponseDefault model = new InlineResponseDefault(); + + /** + * Model tests for InlineResponseDefault + */ + @Test + public void testInlineResponseDefault() { + // TODO: test InlineResponseDefault + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java new file mode 100644 index 000000000000..b51db78af295 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for IsoscelesTriangle + */ +public class IsoscelesTriangleTest { + private final IsoscelesTriangle model = new IsoscelesTriangle(); + + /** + * Model tests for IsoscelesTriangle + */ + @Test + public void testIsoscelesTriangle() { + // TODO: test IsoscelesTriangle + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MammalTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MammalTest.java new file mode 100644 index 000000000000..58c9e49194e8 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MammalTest.java @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Mammal + */ +public class MammalTest { + private final Mammal model = new Mammal(); + + /** + * Model tests for Mammal + */ + @Test + public void testMammal() { + // TODO: test Mammal + } + + /** + * Test the property 'hasBaleen' + */ + @Test + public void hasBaleenTest() { + // TODO: test hasBaleen + } + + /** + * Test the property 'hasTeeth' + */ + @Test + public void hasTeethTest() { + // TODO: test hasTeeth + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 000000000000..a0c991bb7588 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MapTest + */ +public class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + public void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + public void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..630b566f54db --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +public class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + public void mapTest() { + // TODO: test map + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 000000000000..82c7208079db --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Model200Response + */ +public class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 000000000000..97a1287aa413 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 000000000000..f884519ebc86 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelReturn + */ +public class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + public void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NameTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 000000000000..cb3a94cf74ab --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Name + */ +public class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + public void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + public void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 000000000000..380cb9f5c540 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for NullableClass + */ +public class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + public void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + public void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + public void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + public void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + public void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + public void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + public void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + public void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + public void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + public void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + public void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + public void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + public void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NullableShapeTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NullableShapeTest.java new file mode 100644 index 000000000000..9ce46c36f5ea --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NullableShapeTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for NullableShape + */ +public class NullableShapeTest { + private final NullableShape model = new NullableShape(); + + /** + * Model tests for NullableShape + */ + @Test + public void testNullableShape() { + // TODO: test NullableShape + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 000000000000..f4fbd5ee8b42 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for NumberOnly + */ +public class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 000000000000..da63441c6597 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,90 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 000000000000..ebea3ca304c0 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterComposite + */ +public class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + public void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 000000000000..59c4eebd2f0f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterEnumDefaultValue + */ +public class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + public void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 000000000000..fa981c709357 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +public class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + public void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 000000000000..1b98d326bb13 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterEnumInteger + */ +public class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + public void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 000000000000..cf0ebae0faf0 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterEnum + */ +public class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ParentPetTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ParentPetTest.java new file mode 100644 index 000000000000..9e1393c03c40 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ParentPetTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ChildCat; +import org.openapitools.client.model.GrandparentAnimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ParentPet + */ +public class ParentPetTest { + private final ParentPet model = new ParentPet(); + + /** + * Model tests for ParentPet + */ + @Test + public void testParentPet() { + // TODO: test ParentPet + } + + /** + * Test the property 'petType' + */ + @Test + public void petTypeTest() { + // TODO: test petType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/PetTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 000000000000..c3c0d4cc35dd --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,93 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/PigTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/PigTest.java new file mode 100644 index 000000000000..4fc8bfae7dcb --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/PigTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BasquePig; +import org.openapitools.client.model.DanishPig; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Pig + */ +public class PigTest { + private final Pig model = new Pig(); + + /** + * Model tests for Pig + */ + @Test + public void testPig() { + // TODO: test Pig + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java new file mode 100644 index 000000000000..718ab0efe92c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for QuadrilateralInterface + */ +public class QuadrilateralInterfaceTest { + private final QuadrilateralInterface model = new QuadrilateralInterface(); + + /** + * Model tests for QuadrilateralInterface + */ + @Test + public void testQuadrilateralInterface() { + // TODO: test QuadrilateralInterface + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/QuadrilateralTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/QuadrilateralTest.java new file mode 100644 index 000000000000..75a2d3c42f45 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/QuadrilateralTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ComplexQuadrilateral; +import org.openapitools.client.model.SimpleQuadrilateral; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Quadrilateral + */ +public class QuadrilateralTest { + private final Quadrilateral model = new Quadrilateral(); + + /** + * Model tests for Quadrilateral + */ + @Test + public void testQuadrilateral() { + // TODO: test Quadrilateral + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..b82a7d0ef561 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ReadOnlyFirst + */ +public class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + public void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java new file mode 100644 index 000000000000..6f5fb0093e45 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ScaleneTriangle + */ +public class ScaleneTriangleTest { + private final ScaleneTriangle model = new ScaleneTriangle(); + + /** + * Model tests for ScaleneTriangle + */ + @Test + public void testScaleneTriangle() { + // TODO: test ScaleneTriangle + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java new file mode 100644 index 000000000000..9c22ccba6d37 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ShapeInterface + */ +public class ShapeInterfaceTest { + private final ShapeInterface model = new ShapeInterface(); + + /** + * Model tests for ShapeInterface + */ + @Test + public void testShapeInterface() { + // TODO: test ShapeInterface + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java new file mode 100644 index 000000000000..65468232ee58 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ShapeOrNull + */ +public class ShapeOrNullTest { + private final ShapeOrNull model = new ShapeOrNull(); + + /** + * Model tests for ShapeOrNull + */ + @Test + public void testShapeOrNull() { + // TODO: test ShapeOrNull + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeTest.java new file mode 100644 index 000000000000..b882ac315568 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ShapeTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Shape + */ +public class ShapeTest { + private final Shape model = new Shape(); + + /** + * Model tests for Shape + */ + @Test + public void testShape() { + // TODO: test Shape + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java new file mode 100644 index 000000000000..b1dda86fe7f2 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.QuadrilateralInterface; +import org.openapitools.client.model.ShapeInterface; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SimpleQuadrilateral + */ +public class SimpleQuadrilateralTest { + private final SimpleQuadrilateral model = new SimpleQuadrilateral(); + + /** + * Model tests for SimpleQuadrilateral + */ + @Test + public void testSimpleQuadrilateral() { + // TODO: test SimpleQuadrilateral + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..d5a19c371e68 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialModelName + */ +public class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TagTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 000000000000..5c2cc6f49e05 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java new file mode 100644 index 000000000000..d07b83711447 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for TriangleInterface + */ +public class TriangleInterfaceTest { + private final TriangleInterface model = new TriangleInterface(); + + /** + * Model tests for TriangleInterface + */ + @Test + public void testTriangleInterface() { + // TODO: test TriangleInterface + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TriangleTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TriangleTest.java new file mode 100644 index 000000000000..2c9070813847 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/TriangleTest.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.EquilateralTriangle; +import org.openapitools.client.model.IsoscelesTriangle; +import org.openapitools.client.model.ScaleneTriangle; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Triangle + */ +public class TriangleTest { + private final Triangle model = new Triangle(); + + /** + * Model tests for Triangle + */ + @Test + public void testTriangle() { + // TODO: test Triangle + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/UserTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 000000000000..f5a8e85cb65c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + + /** + * Test the property 'objectWithNoDeclaredProps' + */ + @Test + public void objectWithNoDeclaredPropsTest() { + // TODO: test objectWithNoDeclaredProps + } + + /** + * Test the property 'objectWithNoDeclaredPropsNullable' + */ + @Test + public void objectWithNoDeclaredPropsNullableTest() { + // TODO: test objectWithNoDeclaredPropsNullable + } + + /** + * Test the property 'anyTypeProp' + */ + @Test + public void anyTypePropTest() { + // TODO: test anyTypeProp + } + + /** + * Test the property 'anyTypePropNullable' + */ + @Test + public void anyTypePropNullableTest() { + // TODO: test anyTypePropNullable + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/WhaleTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/WhaleTest.java new file mode 100644 index 000000000000..26810e2c280e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/WhaleTest.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Whale + */ +public class WhaleTest { + private final Whale model = new Whale(); + + /** + * Model tests for Whale + */ + @Test + public void testWhale() { + // TODO: test Whale + } + + /** + * Test the property 'hasBaleen' + */ + @Test + public void hasBaleenTest() { + // TODO: test hasBaleen + } + + /** + * Test the property 'hasTeeth' + */ + @Test + public void hasTeethTest() { + // TODO: test hasTeeth + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ZebraTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ZebraTest.java new file mode 100644 index 000000000000..28ce0c1d7f88 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ZebraTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.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. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Zebra + */ +public class ZebraTest { + private final Zebra model = new Zebra(); + + /** + * Model tests for Zebra + */ + @Test + public void testZebra() { + // TODO: test Zebra + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + +} From 5877e3001d6e4f29b4d4a3112f8f01aec9dd8357 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Sun, 31 May 2020 18:02:17 +0300 Subject: [PATCH 03/12] [php-lumen] Show required PHP version in docs (#6501) * Add required PHP version to readme * Add requried PHP version to @phpdoc --- .../src/main/resources/php-lumen/licenseInfo.mustache | 1 + .../openapi-generator/src/main/resources/php-lumen/readme.md | 3 +++ .../php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php | 1 + .../petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php | 1 + .../lib/app/Http/Controllers/FakeClassnameTags123Api.php | 1 + .../petstore/php-lumen/lib/app/Http/Controllers/PetApi.php | 1 + .../petstore/php-lumen/lib/app/Http/Controllers/StoreApi.php | 1 + .../petstore/php-lumen/lib/app/Http/Controllers/UserApi.php | 1 + samples/server/petstore/php-lumen/lib/readme.md | 3 +++ samples/server/petstore/php-lumen/lib/routes/web.php | 1 + 10 files changed, 14 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/php-lumen/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/php-lumen/licenseInfo.mustache index 9866f297a4d7..ef8396ce24d4 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/php-lumen/licenseInfo.mustache @@ -1,6 +1,7 @@ /** * {{{appName}}} * {{{appDescription}}} + * PHP version 7.1.3 * * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} diff --git a/modules/openapi-generator/src/main/resources/php-lumen/readme.md b/modules/openapi-generator/src/main/resources/php-lumen/readme.md index e0dba8a2f5ca..77316595b804 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/readme.md +++ b/modules/openapi-generator/src/main/resources/php-lumen/readme.md @@ -1,5 +1,8 @@ # OpenAPITools generated server +## Requirements +* PHP 7.1.3 or newer + ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification/) from a remote server, you can easily generate a server stub. This diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php index 322f09736fa5..135cd3b23236 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/AnotherFakeApi.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php index cbc65e59a4d6..e01b2014f75c 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeClassnameTags123Api.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeClassnameTags123Api.php index 1b60b7d6361c..2c9d145a10bc 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeClassnameTags123Api.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeClassnameTags123Api.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php index 5667a6f98523..679719dda0d4 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/PetApi.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/StoreApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/StoreApi.php index 76caa0054843..55efa5680dcd 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/StoreApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/StoreApi.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/UserApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/UserApi.php index e6667053a095..d878c1e85057 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/UserApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/UserApi.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-lumen/lib/readme.md b/samples/server/petstore/php-lumen/lib/readme.md index e0dba8a2f5ca..77316595b804 100644 --- a/samples/server/petstore/php-lumen/lib/readme.md +++ b/samples/server/petstore/php-lumen/lib/readme.md @@ -1,5 +1,8 @@ # OpenAPITools generated server +## Requirements +* PHP 7.1.3 or newer + ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification/) from a remote server, you can easily generate a server stub. This diff --git a/samples/server/petstore/php-lumen/lib/routes/web.php b/samples/server/petstore/php-lumen/lib/routes/web.php index 9ffff0e0c73a..14bd40610b22 100644 --- a/samples/server/petstore/php-lumen/lib/routes/web.php +++ b/samples/server/petstore/php-lumen/lib/routes/web.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * From 39eb32ec2718d22f1f185c2bd62da51d47662416 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Sun, 31 May 2020 18:02:35 +0300 Subject: [PATCH 04/12] [php-laravel] Show required PHP version in docs (#6502) * Add required PHP version to readme * Add requried PHP version to @phpdoc --- .../openapi-generator/src/main/resources/php-laravel/README.md | 3 +++ .../src/main/resources/php-laravel/licenseInfo.mustache | 1 + samples/server/petstore/php-laravel/lib/README.md | 3 +++ .../lib/app/Http/Controllers/AnotherFakeController.php | 1 + .../app/Http/Controllers/FakeClassnameTags123Controller.php | 1 + .../php-laravel/lib/app/Http/Controllers/FakeController.php | 1 + .../php-laravel/lib/app/Http/Controllers/PetController.php | 1 + .../php-laravel/lib/app/Http/Controllers/StoreController.php | 1 + .../php-laravel/lib/app/Http/Controllers/UserController.php | 1 + samples/server/petstore/php-laravel/lib/routes/api.php | 1 + samples/server/petstore/php-laravel/lib/routes/channels.php | 1 + samples/server/petstore/php-laravel/lib/routes/console.php | 1 + samples/server/petstore/php-laravel/lib/routes/web.php | 1 + 13 files changed, 17 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/php-laravel/README.md b/modules/openapi-generator/src/main/resources/php-laravel/README.md index 76ceb65d21f6..607a00a0ad2a 100644 --- a/modules/openapi-generator/src/main/resources/php-laravel/README.md +++ b/modules/openapi-generator/src/main/resources/php-laravel/README.md @@ -1,5 +1,8 @@ # OpenAPI generated server +## Requirements +* PHP 7.1.3 or newer + ## Overview This server was generated by the [openapi-generator](https://github.com/openapitools/openapi-generator) project. By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This diff --git a/modules/openapi-generator/src/main/resources/php-laravel/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/php-laravel/licenseInfo.mustache index 63721e9a8946..acdb498a673f 100644 --- a/modules/openapi-generator/src/main/resources/php-laravel/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/php-laravel/licenseInfo.mustache @@ -1,6 +1,7 @@ /** * {{{appName}}} * {{{appDescription}}} + * PHP version 7.1.3 * * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} diff --git a/samples/server/petstore/php-laravel/lib/README.md b/samples/server/petstore/php-laravel/lib/README.md index 76ceb65d21f6..607a00a0ad2a 100644 --- a/samples/server/petstore/php-laravel/lib/README.md +++ b/samples/server/petstore/php-laravel/lib/README.md @@ -1,5 +1,8 @@ # OpenAPI generated server +## Requirements +* PHP 7.1.3 or newer + ## Overview This server was generated by the [openapi-generator](https://github.com/openapitools/openapi-generator) project. By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php index 700d13d11e45..5c0f1920227c 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/AnotherFakeController.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php index 46ccd6e5fd6e..b7d0cda25324 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeClassnameTags123Controller.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php index d883a0108d79..d308d6d15730 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php index 5fc490b27cc1..6ce841dc2faa 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/PetController.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php index 6c7013f5b635..4a6f2e18a8d5 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/StoreController.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php index 365502a3beec..3477a0b5255b 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/UserController.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/routes/api.php b/samples/server/petstore/php-laravel/lib/routes/api.php index 0fd1c22d3efa..b67eb068a078 100644 --- a/samples/server/petstore/php-laravel/lib/routes/api.php +++ b/samples/server/petstore/php-laravel/lib/routes/api.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/routes/channels.php b/samples/server/petstore/php-laravel/lib/routes/channels.php index ce848a9a1b03..a149aa63f030 100644 --- a/samples/server/petstore/php-laravel/lib/routes/channels.php +++ b/samples/server/petstore/php-laravel/lib/routes/channels.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/routes/console.php b/samples/server/petstore/php-laravel/lib/routes/console.php index 0ed63f6741a7..12e2fa86f31f 100644 --- a/samples/server/petstore/php-laravel/lib/routes/console.php +++ b/samples/server/petstore/php-laravel/lib/routes/console.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/server/petstore/php-laravel/lib/routes/web.php b/samples/server/petstore/php-laravel/lib/routes/web.php index 325aca0792e7..0fbf681e45bf 100644 --- a/samples/server/petstore/php-laravel/lib/routes/web.php +++ b/samples/server/petstore/php-laravel/lib/routes/web.php @@ -3,6 +3,7 @@ /** * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * PHP version 7.1.3 * * The version of the OpenAPI document: 1.0.0 * From a96e783f060d44e84a2071c367072ca86b2cd7b8 Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Sun, 31 May 2020 08:03:12 -0700 Subject: [PATCH 05/12] Fix docs typos (#6478) --- docs/faq-contributing.md | 4 ++-- docs/installation.md | 4 ++-- docs/integration.md | 4 ++-- website/src/pages/index.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/faq-contributing.md b/docs/faq-contributing.md index 4652194e9d76..704758bb443f 100644 --- a/docs/faq-contributing.md +++ b/docs/faq-contributing.md @@ -45,9 +45,9 @@ Please refer to http://rypress.com/tutorials/git/rebasing, or follow the steps b (To setup `upstream` pointing to the official repo, please run `git remote add upstream https://github.com/openapitools/openapi-generator.git`) -## How can I update commits that are not linked to my Github account? +## How can I update commits that are not linked to my GitHub account? -Please refer to https://stackoverflow.com/questions/3042437/how-to-change-the-commit-author-for-one-specific-commit or you can simply add the email address in the commit as your secondary email address in your Github account. +Please refer to https://stackoverflow.com/questions/3042437/how-to-change-the-commit-author-for-one-specific-commit or you can simply add the email address in the commit as your secondary email address in your GitHub account. ## Any useful git tips to share? diff --git a/docs/installation.md b/docs/installation.md index 274024c9478f..f3015d1e7a1e 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -8,11 +8,11 @@ Installing OpenAPI Generator's CLI tool allows users to generate all available g Some of the following are cross-platform options and some are not, these are called out where possible. -## NPM +## npm > **Platform(s)**: Linux, macOS, Windows -The [NPM package wrapper](https://github.com/openapitools/openapi-generator-cli) is cross-platform wrapper around the .jar artifact. It works by providing a CLI wrapper atop the JAR's command line options. This gives a simple interface layer which normalizes usage of the command line across operating systems, removing some differences in how options or switches are passed to the tool (depending on OS). +The [npm package wrapper](https://github.com/openapitools/openapi-generator-cli) is cross-platform wrapper around the .jar artifact. It works by providing a CLI wrapper atop the JAR's command line options. This gives a simple interface layer which normalizes usage of the command line across operating systems, removing some differences in how options or switches are passed to the tool (depending on OS). **Install** the latest version of the tool globally, exposing the CLI on the command line: ```bash diff --git a/docs/integration.md b/docs/integration.md index fdf2898646d2..8b5b2ca52195 100644 --- a/docs/integration.md +++ b/docs/integration.md @@ -2,7 +2,7 @@ id: integrations title: Workflow Integrations --- -## Workflow Integration (Maven, Github, CI/CD) +## Workflow Integration (Maven, GitHub, CI/CD) ### Gradle Integration @@ -39,7 +39,7 @@ To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline -i modules/openapi-generator/src/test/resources/2_0/petstore.json -g perl \ --git-user-id "wing328" \ --git-repo-id "petstore-perl" \ - --release-note "Github integration demo" \ + --release-note "GitHub integration demo" \ -o /var/tmp/perl/petstore ``` 3) Push the SDK to GitHub diff --git a/website/src/pages/index.js b/website/src/pages/index.js index 21393e443f6a..cf40dfbafa03 100755 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -127,11 +127,11 @@ const callouts = [ { id: 'try', imageUrl: 'img/tools/npm.svg', - title: <>Try via NPM, + title: <>Try via npm, content: ( <>

- The NPM package + The npm package wrapper is cross-platform wrapper around the .jar artifact.

From e3eb3c2f7dadd4e0edc940055dffb625dd9cf788 Mon Sep 17 00:00:00 2001 From: Samuel Kahn <48932506+Kahncode@users.noreply.github.com> Date: Sun, 31 May 2020 18:13:12 +0200 Subject: [PATCH 06/12] UE4 client generator fixes (#6438) * Added the possibility for a codegen to set the location of the generated model files, similarly to API files. * Removed std::shared_ptr from the generated types. Types in UE4Codegen are handled as POD structs, not shared pointers. * Fixed handling of body parameters as per the specification, the single body object is written directly as the payload. * Fixed handling of files and binaries, if a field is both isFile and isBinary, file will take precedence. * Updated cpp-ue4 client samples * Fixed handling of enums in models Co-authored-by: William Cheng --- .../openapitools/codegen/CodegenConfig.java | 2 ++ .../openapitools/codegen/DefaultCodegen.java | 5 +++ .../codegen/DefaultGenerator.java | 9 ++---- .../languages/CppUE4ClientCodegen.java | 10 +++--- .../cpp-ue4/api-operations-source.mustache | 16 +++++----- .../resources/cpp-ue4/model-source.mustache | 2 ++ .../petstore/cpp-ue4/.openapi-generator/FILES | 31 +++++++++++++++++++ .../{ => Private}/OpenAPIApiResponse.cpp | 0 .../cpp-ue4/{ => Private}/OpenAPICategory.cpp | 0 .../cpp-ue4/{ => Private}/OpenAPIOrder.cpp | 5 ++- .../cpp-ue4/{ => Private}/OpenAPIPet.cpp | 5 ++- .../Private/OpenAPIPetApiOperations.cpp | 9 ++---- .../Private/OpenAPIStoreApiOperations.cpp | 4 +-- .../cpp-ue4/{ => Private}/OpenAPITag.cpp | 0 .../cpp-ue4/{ => Private}/OpenAPIUser.cpp | 0 .../Private/OpenAPIUserApiOperations.cpp | 16 +++------- .../cpp-ue4/{ => Public}/OpenAPIApiResponse.h | 0 .../cpp-ue4/{ => Public}/OpenAPICategory.h | 0 .../cpp-ue4/{ => Public}/OpenAPIOrder.h | 0 .../cpp-ue4/{ => Public}/OpenAPIPet.h | 4 +-- .../cpp-ue4/Public/OpenAPIPetApiOperations.h | 12 +++---- .../Public/OpenAPIStoreApiOperations.h | 4 +-- .../cpp-ue4/{ => Public}/OpenAPITag.h | 0 .../cpp-ue4/{ => Public}/OpenAPIUser.h | 0 .../cpp-ue4/Public/OpenAPIUserApiOperations.h | 8 ++--- 25 files changed, 84 insertions(+), 58 deletions(-) create mode 100644 samples/client/petstore/cpp-ue4/.openapi-generator/FILES rename samples/client/petstore/cpp-ue4/{ => Private}/OpenAPIApiResponse.cpp (100%) rename samples/client/petstore/cpp-ue4/{ => Private}/OpenAPICategory.cpp (100%) rename samples/client/petstore/cpp-ue4/{ => Private}/OpenAPIOrder.cpp (93%) rename samples/client/petstore/cpp-ue4/{ => Private}/OpenAPIPet.cpp (94%) rename samples/client/petstore/cpp-ue4/{ => Private}/OpenAPITag.cpp (100%) rename samples/client/petstore/cpp-ue4/{ => Private}/OpenAPIUser.cpp (100%) rename samples/client/petstore/cpp-ue4/{ => Public}/OpenAPIApiResponse.h (100%) rename samples/client/petstore/cpp-ue4/{ => Public}/OpenAPICategory.h (100%) rename samples/client/petstore/cpp-ue4/{ => Public}/OpenAPIOrder.h (100%) rename samples/client/petstore/cpp-ue4/{ => Public}/OpenAPIPet.h (89%) rename samples/client/petstore/cpp-ue4/{ => Public}/OpenAPITag.h (100%) rename samples/client/petstore/cpp-ue4/{ => Public}/OpenAPIUser.h (100%) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java index 5b05c3ccf422..26b91464f898 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java @@ -192,6 +192,8 @@ public interface CodegenConfig { void postProcessParameter(CodegenParameter parameter); + String modelFilename(String templateName, String modelName); + String apiFilename(String templateName, String tag); String apiTestFilename(String templateName, String tag); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index fec45254f055..d711a4064097 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4828,6 +4828,11 @@ public String apiFilename(String templateName, String tag) { return apiFileFolder() + File.separator + toApiFilename(tag) + suffix; } + public String modelFilename(String templateName, String modelName) { + String suffix = modelTemplateFiles().get(templateName); + return modelFileFolder() + File.separator + toModelFilename(modelName) + suffix; + } + /** * Return the full path and API documentation file * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index ac72d822c985..f99a6c2d2e22 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -363,14 +363,9 @@ private void generateModelDocumentation(List files, Map mo } } - private String getModelFilenameByTemplate(String modelName, String templateName){ - String suffix = config.modelTemplateFiles().get(templateName); - return config.modelFileFolder() + File.separator + config.toModelFilename(modelName) + suffix; - } - private void generateModel(List files, Map models, String modelName) throws IOException { for (String templateName : config.modelTemplateFiles().keySet()) { - String filename = getModelFilenameByTemplate(modelName, templateName); + String filename = config.modelFilename(templateName, modelName); File written = processTemplateToFile(models, templateName, filename, generateModels, CodegenConstants.MODELS); if (written != null) { files.add(written); @@ -429,7 +424,7 @@ void generateModels(List files, List allModels, List unuse for (String templateName : config.modelTemplateFiles().keySet()) { // HACK: Because this returns early, could lead to some invalid model reporting. - String filename = getModelFilenameByTemplate(name, templateName); + String filename = config.modelFilename(templateName, name); Path path = java.nio.file.Paths.get(filename); this.templateProcessor.skip(path,"Skipped prior to model processing due to import mapping conflict (either by user or by generator)." ); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java index 175a64160a1b..064b5282f62a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java @@ -331,18 +331,16 @@ public String apiFileFolder() { return outputFolder + File.separator + apiPackage().replace("::", File.separator); } - /* @Override - public String modelFilename(String templateName, String tag) { + public String modelFilename(String templateName, String modelName) { String suffix = modelTemplateFiles().get(templateName); String folder = privateFolder; if (suffix == ".h") { folder = publicFolder; } - return modelFileFolder() + File.separator + folder + File.separator + toModelFilename(tag) + suffix; + return modelFileFolder() + File.separator + folder + File.separator + toModelFilename(modelName) + suffix; } - */ @Override public String toModelFilename(String name) { @@ -399,6 +397,10 @@ public String getTypeDeclaration(Schema p) { } } + @Override + public String getTypeDeclaration(String name) { + return name; + } @Override public String toDefaultValue(Schema p) { diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache index 894e76bc7b7b..8ab14a704cf1 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache @@ -139,19 +139,17 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const TSha FString JsonBody; JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); - Writer->WriteObjectStart(); {{#bodyParams}} {{#required}} - Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{paramName}}); + WriteJsonValue(Writer, {{paramName}}); {{/required}} {{^required}} if ({{paramName}}.IsSet()) { - Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{paramName}}.GetValue()); + WriteJsonValue(Writer, {{paramName}}.GetValue()); } {{/required}} {{/bodyParams}} - Writer->WriteObjectEnd(); Writer->Close(); HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); @@ -176,14 +174,14 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const TSha {{#isFile}} FormData.AddFilePart(TEXT("{{baseName}}"), {{paramName}}); {{/isFile}} + {{^isFile}} {{#isBinary}} FormData.AddBinaryPart(TEXT("{{baseName}}"), {{paramName}}); {{/isBinary}} - {{#isBinary}} - {{^isFile}} + {{^isBinary}} FormData.AddStringPart(TEXT("{{baseName}}"), *ToUrlString({{paramName}})); - {{/isFile}} {{/isBinary}} + {{/isFile}} {{/required}} {{^required}} if({{paramName}}.IsSet()) @@ -191,14 +189,14 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const TSha {{#isFile}} FormData.AddFilePart(TEXT("{{baseName}}"), {{paramName}}.GetValue()); {{/isFile}} + {{^isFile}} {{#isBinary}} FormData.AddBinaryPart(TEXT("{{baseName}}"), {{paramName}}.GetValue()); {{/isBinary}} {{^isBinary}} - {{^isFile}} FormData.AddStringPart(TEXT("{{baseName}}"), *ToUrlString({{paramName}}.GetValue())); - {{/isFile}} {{/isBinary}} + {{/isFile}} } {{/required}} {{/isContainer}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache index 4850fb9859ce..3e9b14788a67 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache @@ -42,6 +42,7 @@ inline void WriteJsonValue(JsonWriter& Writer, const {{classname}}::{{{enumName} inline bool TryGetJsonValue(const TSharedPtr& JsonValue, {{classname}}::{{{enumName}}}& Value) { + {{#allowableValues}} FString TmpValue; if (JsonValue->TryGetString(TmpValue)) { @@ -55,6 +56,7 @@ inline bool TryGetJsonValue(const TSharedPtr& JsonValue, {{classname return true; } } + {{/allowableValues}} return false; } diff --git a/samples/client/petstore/cpp-ue4/.openapi-generator/FILES b/samples/client/petstore/cpp-ue4/.openapi-generator/FILES new file mode 100644 index 000000000000..23079276740b --- /dev/null +++ b/samples/client/petstore/cpp-ue4/.openapi-generator/FILES @@ -0,0 +1,31 @@ +OpenAPI.Build.cs +Private\OpenAPIApiResponse.cpp +Private\OpenAPIBaseModel.cpp +Private\OpenAPICategory.cpp +Private\OpenAPIHelpers.cpp +Private\OpenAPIModule.cpp +Private\OpenAPIModule.h +Private\OpenAPIOrder.cpp +Private\OpenAPIPet.cpp +Private\OpenAPIPetApi.cpp +Private\OpenAPIPetApiOperations.cpp +Private\OpenAPIStoreApi.cpp +Private\OpenAPIStoreApiOperations.cpp +Private\OpenAPITag.cpp +Private\OpenAPIUser.cpp +Private\OpenAPIUserApi.cpp +Private\OpenAPIUserApiOperations.cpp +Public\OpenAPIApiResponse.h +Public\OpenAPIBaseModel.h +Public\OpenAPICategory.h +Public\OpenAPIHelpers.h +Public\OpenAPIOrder.h +Public\OpenAPIPet.h +Public\OpenAPIPetApi.h +Public\OpenAPIPetApiOperations.h +Public\OpenAPIStoreApi.h +Public\OpenAPIStoreApiOperations.h +Public\OpenAPITag.h +Public\OpenAPIUser.h +Public\OpenAPIUserApi.h +Public\OpenAPIUserApiOperations.h diff --git a/samples/client/petstore/cpp-ue4/OpenAPIApiResponse.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIApiResponse.cpp similarity index 100% rename from samples/client/petstore/cpp-ue4/OpenAPIApiResponse.cpp rename to samples/client/petstore/cpp-ue4/Private/OpenAPIApiResponse.cpp diff --git a/samples/client/petstore/cpp-ue4/OpenAPICategory.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPICategory.cpp similarity index 100% rename from samples/client/petstore/cpp-ue4/OpenAPICategory.cpp rename to samples/client/petstore/cpp-ue4/Private/OpenAPICategory.cpp diff --git a/samples/client/petstore/cpp-ue4/OpenAPIOrder.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIOrder.cpp similarity index 93% rename from samples/client/petstore/cpp-ue4/OpenAPIOrder.cpp rename to samples/client/petstore/cpp-ue4/Private/OpenAPIOrder.cpp index cd8e524b0496..f125c7ae40b1 100644 --- a/samples/client/petstore/cpp-ue4/OpenAPIOrder.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIOrder.cpp @@ -51,7 +51,10 @@ inline bool TryGetJsonValue(const TSharedPtr& JsonValue, OpenAPIOrde FString TmpValue; if (JsonValue->TryGetString(TmpValue)) { - static TMap StringToEnum = { }; + static TMap StringToEnum = { + { TEXT("placed"), OpenAPIOrder::StatusEnum::Placed }, + { TEXT("approved"), OpenAPIOrder::StatusEnum::Approved }, + { TEXT("delivered"), OpenAPIOrder::StatusEnum::Delivered }, }; const auto Found = StringToEnum.Find(TmpValue); if(Found) diff --git a/samples/client/petstore/cpp-ue4/OpenAPIPet.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIPet.cpp similarity index 94% rename from samples/client/petstore/cpp-ue4/OpenAPIPet.cpp rename to samples/client/petstore/cpp-ue4/Private/OpenAPIPet.cpp index d1d1a690d6c5..b36df84ae6b7 100644 --- a/samples/client/petstore/cpp-ue4/OpenAPIPet.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIPet.cpp @@ -51,7 +51,10 @@ inline bool TryGetJsonValue(const TSharedPtr& JsonValue, OpenAPIPet: FString TmpValue; if (JsonValue->TryGetString(TmpValue)) { - static TMap StringToEnum = { }; + static TMap StringToEnum = { + { TEXT("available"), OpenAPIPet::StatusEnum::Available }, + { TEXT("pending"), OpenAPIPet::StatusEnum::Pending }, + { TEXT("sold"), OpenAPIPet::StatusEnum::Sold }, }; const auto Found = StringToEnum.Find(TmpValue); if(Found) diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp index 8ca1ec220fd5..4df6f9160880 100644 --- a/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp @@ -43,9 +43,7 @@ void OpenAPIPetApi::AddPetRequest::SetupHttpRequest(const TSharedRef::Create(&JsonBody); - Writer->WriteObjectStart(); - Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); - Writer->WriteObjectEnd(); + WriteJsonValue(Writer, Body); Writer->Close(); HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); @@ -366,9 +364,7 @@ void OpenAPIPetApi::UpdatePetRequest::SetupHttpRequest(const TSharedRef::Create(&JsonBody); - Writer->WriteObjectStart(); - Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); - Writer->WriteObjectEnd(); + WriteJsonValue(Writer, Body); Writer->Close(); HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); @@ -517,7 +513,6 @@ void OpenAPIPetApi::UploadFileRequest::SetupHttpRequest(const TSharedRef::Create(&JsonBody); - Writer->WriteObjectStart(); - Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); - Writer->WriteObjectEnd(); + WriteJsonValue(Writer, Body); Writer->Close(); HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); diff --git a/samples/client/petstore/cpp-ue4/OpenAPITag.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPITag.cpp similarity index 100% rename from samples/client/petstore/cpp-ue4/OpenAPITag.cpp rename to samples/client/petstore/cpp-ue4/Private/OpenAPITag.cpp diff --git a/samples/client/petstore/cpp-ue4/OpenAPIUser.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIUser.cpp similarity index 100% rename from samples/client/petstore/cpp-ue4/OpenAPIUser.cpp rename to samples/client/petstore/cpp-ue4/Private/OpenAPIUser.cpp diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp index c31afe5ba13e..97562911f703 100644 --- a/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp @@ -43,9 +43,7 @@ void OpenAPIUserApi::CreateUserRequest::SetupHttpRequest(const TSharedRef::Create(&JsonBody); - Writer->WriteObjectStart(); - Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); - Writer->WriteObjectEnd(); + WriteJsonValue(Writer, Body); Writer->Close(); HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); @@ -102,9 +100,7 @@ void OpenAPIUserApi::CreateUsersWithArrayInputRequest::SetupHttpRequest(const TS FString JsonBody; JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); - Writer->WriteObjectStart(); - Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); - Writer->WriteObjectEnd(); + WriteJsonValue(Writer, Body); Writer->Close(); HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); @@ -161,9 +157,7 @@ void OpenAPIUserApi::CreateUsersWithListInputRequest::SetupHttpRequest(const TSh FString JsonBody; JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); - Writer->WriteObjectStart(); - Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); - Writer->WriteObjectEnd(); + WriteJsonValue(Writer, Body); Writer->Close(); HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); @@ -433,9 +427,7 @@ void OpenAPIUserApi::UpdateUserRequest::SetupHttpRequest(const TSharedRef::Create(&JsonBody); - Writer->WriteObjectStart(); - Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); - Writer->WriteObjectEnd(); + WriteJsonValue(Writer, Body); Writer->Close(); HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); diff --git a/samples/client/petstore/cpp-ue4/OpenAPIApiResponse.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIApiResponse.h similarity index 100% rename from samples/client/petstore/cpp-ue4/OpenAPIApiResponse.h rename to samples/client/petstore/cpp-ue4/Public/OpenAPIApiResponse.h diff --git a/samples/client/petstore/cpp-ue4/OpenAPICategory.h b/samples/client/petstore/cpp-ue4/Public/OpenAPICategory.h similarity index 100% rename from samples/client/petstore/cpp-ue4/OpenAPICategory.h rename to samples/client/petstore/cpp-ue4/Public/OpenAPICategory.h diff --git a/samples/client/petstore/cpp-ue4/OpenAPIOrder.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIOrder.h similarity index 100% rename from samples/client/petstore/cpp-ue4/OpenAPIOrder.h rename to samples/client/petstore/cpp-ue4/Public/OpenAPIOrder.h diff --git a/samples/client/petstore/cpp-ue4/OpenAPIPet.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIPet.h similarity index 89% rename from samples/client/petstore/cpp-ue4/OpenAPIPet.h rename to samples/client/petstore/cpp-ue4/Public/OpenAPIPet.h index 3a90d2b0c6b1..0e81e5fe0f9c 100644 --- a/samples/client/petstore/cpp-ue4/OpenAPIPet.h +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIPet.h @@ -34,8 +34,8 @@ class OPENAPI_API OpenAPIPet : public Model TOptional Id; TOptional Category; FString Name; - TArray> PhotoUrls; - TOptional>> Tags; + TArray PhotoUrls; + TOptional> Tags; enum class StatusEnum { Available, diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIPetApiOperations.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIPetApiOperations.h index 2667a08066b7..a93365d9546a 100644 --- a/samples/client/petstore/cpp-ue4/Public/OpenAPIPetApiOperations.h +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIPetApiOperations.h @@ -33,7 +33,7 @@ class OPENAPI_API OpenAPIPetApi::AddPetRequest : public Request FString ComputePath() const final; /* Pet object that needs to be added to the store */ - std::shared_ptr Body; + OpenAPIPet Body; }; class OPENAPI_API OpenAPIPetApi::AddPetResponse : public Response @@ -89,7 +89,7 @@ class OPENAPI_API OpenAPIPetApi::FindPetsByStatusRequest : public Request Sold, }; /* Status values that need to be considered for filter */ - TArray> Status; + TArray Status; }; class OPENAPI_API OpenAPIPetApi::FindPetsByStatusResponse : public Response @@ -99,7 +99,7 @@ class OPENAPI_API OpenAPIPetApi::FindPetsByStatusResponse : public Response void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; bool FromJson(const TSharedPtr& JsonObject) final; - TArray> Content; + TArray Content; }; /* Finds Pets by tags @@ -114,7 +114,7 @@ class OPENAPI_API OpenAPIPetApi::FindPetsByTagsRequest : public Request FString ComputePath() const final; /* Tags to filter by */ - TArray> Tags; + TArray Tags; }; class OPENAPI_API OpenAPIPetApi::FindPetsByTagsResponse : public Response @@ -124,7 +124,7 @@ class OPENAPI_API OpenAPIPetApi::FindPetsByTagsResponse : public Response void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; bool FromJson(const TSharedPtr& JsonObject) final; - TArray> Content; + TArray Content; }; /* Find pet by ID @@ -163,7 +163,7 @@ class OPENAPI_API OpenAPIPetApi::UpdatePetRequest : public Request FString ComputePath() const final; /* Pet object that needs to be added to the store */ - std::shared_ptr Body; + OpenAPIPet Body; }; class OPENAPI_API OpenAPIPetApi::UpdatePetResponse : public Response diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApiOperations.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApiOperations.h index 924bb148dd46..06e6809c1850 100644 --- a/samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApiOperations.h +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApiOperations.h @@ -65,7 +65,7 @@ class OPENAPI_API OpenAPIStoreApi::GetInventoryResponse : public Response void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; bool FromJson(const TSharedPtr& JsonObject) final; - TMap> Content; + TMap Content; }; /* Find purchase order by ID @@ -104,7 +104,7 @@ class OPENAPI_API OpenAPIStoreApi::PlaceOrderRequest : public Request FString ComputePath() const final; /* order placed for purchasing the pet */ - std::shared_ptr Body; + OpenAPIOrder Body; }; class OPENAPI_API OpenAPIStoreApi::PlaceOrderResponse : public Response diff --git a/samples/client/petstore/cpp-ue4/OpenAPITag.h b/samples/client/petstore/cpp-ue4/Public/OpenAPITag.h similarity index 100% rename from samples/client/petstore/cpp-ue4/OpenAPITag.h rename to samples/client/petstore/cpp-ue4/Public/OpenAPITag.h diff --git a/samples/client/petstore/cpp-ue4/OpenAPIUser.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIUser.h similarity index 100% rename from samples/client/petstore/cpp-ue4/OpenAPIUser.h rename to samples/client/petstore/cpp-ue4/Public/OpenAPIUser.h diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIUserApiOperations.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIUserApiOperations.h index 2b0ab2e5385e..3e050a41ef08 100644 --- a/samples/client/petstore/cpp-ue4/Public/OpenAPIUserApiOperations.h +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIUserApiOperations.h @@ -32,7 +32,7 @@ class OPENAPI_API OpenAPIUserApi::CreateUserRequest : public Request FString ComputePath() const final; /* Created user object */ - std::shared_ptr Body; + OpenAPIUser Body; }; class OPENAPI_API OpenAPIUserApi::CreateUserResponse : public Response @@ -56,7 +56,7 @@ class OPENAPI_API OpenAPIUserApi::CreateUsersWithArrayInputRequest : public Requ FString ComputePath() const final; /* List of user object */ - TArray> Body; + TArray Body; }; class OPENAPI_API OpenAPIUserApi::CreateUsersWithArrayInputResponse : public Response @@ -80,7 +80,7 @@ class OPENAPI_API OpenAPIUserApi::CreateUsersWithListInputRequest : public Reque FString ComputePath() const final; /* List of user object */ - TArray> Body; + TArray Body; }; class OPENAPI_API OpenAPIUserApi::CreateUsersWithListInputResponse : public Response @@ -204,7 +204,7 @@ class OPENAPI_API OpenAPIUserApi::UpdateUserRequest : public Request /* name that need to be deleted */ FString Username; /* Updated user object */ - std::shared_ptr Body; + OpenAPIUser Body; }; class OPENAPI_API OpenAPIUserApi::UpdateUserResponse : public Response From 15be875275fb824d53c770f2142f9dda44148830 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 1 Jun 2020 11:08:15 +0800 Subject: [PATCH 07/12] [Java][Jersey2] add petstore integration tests (#6508) * add tests to jersey2 client * remove import --- bin/java-petstore-jersey2-java7.json | 5 - .../openapitools/client/api/PetApiTest.java | 140 +++++++++++------- 2 files changed, 86 insertions(+), 59 deletions(-) delete mode 100644 bin/java-petstore-jersey2-java7.json diff --git a/bin/java-petstore-jersey2-java7.json b/bin/java-petstore-jersey2-java7.json deleted file mode 100644 index a5e2254fdb3a..000000000000 --- a/bin/java-petstore-jersey2-java7.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "library": "jersey2", - "java8": false, - "artifactId": "petstore-jersey2-java7" -} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java index 1ab8611db472..11dcafbcc11d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -13,97 +13,142 @@ package org.openapitools.client.api; -import org.openapitools.client.*; -import org.openapitools.client.auth.*; -import java.io.File; -import org.openapitools.client.model.ModelApiResponse; -import org.openapitools.client.model.Pet; +import org.junit.Assert; import org.junit.Test; -import org.junit.Ignore; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.ApiKeyAuth; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.Tag; -import java.util.ArrayList; -import java.util.HashMap; +import java.io.File; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; /** * API tests for PetApi */ -@Ignore public class PetApiTest { private final PetApi api = new PetApi(); + private final long petId = 5638l; /** * Add a new pet to the store * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void addPetTest() throws ApiException { - Pet body = null; + // add pet + Pet body = new Pet(); + body.setId(petId); + body.setName("jersey2 java8 pet"); + Category category = new Category(); + category.setId(petId); + category.setName("jersey2 java8 category"); + body.setCategory(category); + body.setStatus(Pet.StatusEnum.AVAILABLE); + body.setPhotoUrls(new HashSet<>(Arrays.asList("A", "B", "C"))); + Tag tag = new Tag(); + tag.setId(petId); + tag.setName("jersey2 java8 tag"); + body.setTags(Arrays.asList(tag)); + api.addPet(body); - // TODO: test validations + + //get pet by ID + Pet result = api.getPetById(petId); + Assert.assertEquals(result.getId(), body.getId()); + Assert.assertEquals(result.getCategory(), category); + Assert.assertEquals(result.getName(), body.getName()); + Assert.assertEquals(result.getPhotoUrls(), body.getPhotoUrls()); + Assert.assertEquals(result.getStatus(), body.getStatus()); + Assert.assertEquals(result.getTags(), body.getTags()); + + // update pet + api.updatePetWithForm(petId, "jersey2 java8 pet 2", "sold"); + + //get pet by ID + Pet result2 = api.getPetById(petId); + Assert.assertEquals(result2.getId(), body.getId()); + Assert.assertEquals(result2.getCategory(), category); + Assert.assertEquals(result2.getName(), "jersey2 java8 pet 2"); + Assert.assertEquals(result2.getPhotoUrls(), body.getPhotoUrls()); + Assert.assertEquals(result2.getStatus(), Pet.StatusEnum.SOLD); + Assert.assertEquals(result2.getTags(), body.getTags()); + + // delete pet + api.deletePet(petId, "empty api key"); + + try { + Pet result3 = api.getPetById(petId); + Assert.assertEquals(false, true); + } catch (ApiException e) { +// System.err.println("Exception when calling PetApi#getPetById"); +// System.err.println("Status code: " + e.getCode()); +// System.err.println("Reason: " + e.getResponseBody()); +// System.err.println("Response headers: " + e.getResponseHeaders()); + + Assert.assertEquals(e.getCode(), 404); + Assert.assertEquals(e.getResponseBody(), "{\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}"); + + } + } /** * Deletes a pet * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void deletePetTest() throws ApiException { Long petId = null; String apiKey = null; - api.deletePet(petId, apiKey); // TODO: test validations + //api.deletePet(petId, apiKey); } /** * Finds Pets by status - * + *

* Multiple status values can be provided with comma separated strings * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void findPetsByStatusTest() throws ApiException { List status = null; - List response = api.findPetsByStatus(status); + //List response = api.findPetsByStatus(status); // TODO: test validations } /** * Finds Pets by tags - * + *

* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void findPetsByTagsTest() throws ApiException { Set tags = null; - Set response = api.findPetsByTags(tags); + //Set response = api.findPetsByTags(tags); // TODO: test validations } /** * Find pet by ID - * + *

* Returns a single pet * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void getPetByIdTest() throws ApiException { @@ -126,7 +171,6 @@ public void getPetByIdTest() throws ApiException { System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); } } @@ -134,66 +178,54 @@ public void getPetByIdTest() throws ApiException { /** * Update an existing pet * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void updatePetTest() throws ApiException { Pet body = null; - api.updatePet(body); + //api.updatePet(body); // TODO: test validations } /** * Updates a pet in the store with form data * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void updatePetWithFormTest() throws ApiException { Long petId = null; String name = null; String status = null; - api.updatePetWithForm(petId, name, status); + //api.updatePetWithForm(petId, name, status); // TODO: test validations } /** * uploads an image * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void uploadFileTest() throws ApiException { Long petId = null; String additionalMetadata = null; File file = null; - ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); // TODO: test validations } /** * uploads an image (required) * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void uploadFileWithRequiredFileTest() throws ApiException { Long petId = null; File requiredFile = null; String additionalMetadata = null; - ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + //ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); // TODO: test validations } From 6783b90fe230360c58b360817887f418475b745b Mon Sep 17 00:00:00 2001 From: fullcircle23 <33846962+fullcircle23@users.noreply.github.com> Date: Mon, 1 Jun 2020 14:12:24 +0800 Subject: [PATCH 08/12] [Python][Client] Fix delimiter collision issue #5981 (#6451) * [python][client] Fix delimiter collision (#5981) * [python][client] Fix delimiter collision (#5981) update samples * [python][client] Fix delimiter collision (#5981) update samples * [python][client] Fix convert to enum var name (#5981) * [python][client] Fix convert to enum var name (#5981) update samples --- .../languages/PythonClientCodegen.java | 43 ++++---- .../python/PythonClientCodegenTest.java | 99 ++++++++++++++++++- 2 files changed, 121 insertions(+), 21 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 5c0df0ab8178..03c285890254 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -683,8 +683,12 @@ public String toDefaultValue(Schema p) { if (p.getDefault() != null) { if (Pattern.compile("\r\n|\r|\n").matcher((String) p.getDefault()).find()) return "'''" + p.getDefault() + "'''"; + else if (p.getEnum() == null) + // wrap using double quotes to avoid the need to escape any embedded single quotes + return "\"" + p.getDefault() + "\""; else - return "'" + ((String) p.getDefault()).replaceAll("'", "\'") + "'"; + // convert to enum var name later in postProcessModels + return (String) p.getDefault(); } } else if (ModelUtils.isArraySchema(p)) { if (p.getDefault() != null) { @@ -728,7 +732,8 @@ private String toExampleValueRecursive(Schema schema, List included_sche if (StringUtils.isNotBlank(example) && !"null".equals(example)) { if (ModelUtils.isStringSchema(schema)) { - example = "'" + example + "'"; + // wrap using double quotes to avoid the need to escape any embedded single quotes + example = "\"" + example + "\""; } return example; } @@ -902,43 +907,45 @@ public void setParameterExampleValue(CodegenParameter p) { type = p.dataType; } - if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) { + if (type != null) { + if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) { if (example == null) { - example = p.paramName + "_example"; + example = p.paramName + "_example"; } example = "'" + escapeText(example) + "'"; - } else if ("Integer".equals(type) || "int".equals(type)) { + } else if ("Integer".equals(type) || "int".equals(type)) { if (example == null) { - example = "56"; + example = "56"; } - } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) { + } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) { if (example == null) { - example = "3.4"; + example = "3.4"; } - } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) { + } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) { if (example == null) { - example = "True"; + example = "True"; } - } else if ("file".equalsIgnoreCase(type)) { + } else if ("file".equalsIgnoreCase(type)) { if (example == null) { - example = "/path/to/file"; + example = "/path/to/file"; } example = "'" + escapeText(example) + "'"; - } else if ("Date".equalsIgnoreCase(type)) { + } else if ("Date".equalsIgnoreCase(type)) { if (example == null) { - example = "2013-10-20"; + example = "2013-10-20"; } example = "'" + escapeText(example) + "'"; - } else if ("DateTime".equalsIgnoreCase(type)) { + } else if ("DateTime".equalsIgnoreCase(type)) { if (example == null) { - example = "2013-10-20T19:20:30+01:00"; + example = "2013-10-20T19:20:30+01:00"; } example = "'" + escapeText(example) + "'"; - } else if (!languageSpecificPrimitives.contains(type)) { + } else if (!languageSpecificPrimitives.contains(type)) { // type is a model class, e.g. User example = this.packageName + "." + type + "()"; - } else { + } else { LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue"); + } } if (example == null) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java index 565e6848f64b..687a04ec3acf 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java @@ -19,11 +19,17 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; +import java.util.HashSet; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModelFactory; +import org.openapitools.codegen.CodegenModelType; import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.PythonClientCodegen; +import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.Test; @@ -93,12 +99,99 @@ public void testRegularExpressionOpenAPISchemaVersion3() { Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i"); } - @Test(description = "test single quotes escape") - public void testSingleQuotes() { + @Test(description = "test default value with single quotes") + public void testSingleQuotesDefaultValue() { final PythonClientCodegen codegen = new PythonClientCodegen(); StringSchema schema = new StringSchema(); schema.setDefault("Text containing 'single' quote"); String defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals("'Text containing \'single\' quote'", defaultValue); + Assert.assertEquals(defaultValue, "\"Text containing 'single' quote\""); + } + + @Test(description = "test example value with single quotes") + public void testSingleQuotesExampleValue() { + final PythonClientCodegen codegen = new PythonClientCodegen(); + StringSchema schema = new StringSchema(); + schema.setExample("Text containing 'single' quote"); + String exampleValue = codegen.toExampleValue(schema); + Assert.assertEquals(exampleValue, "\"Text containing 'single' quote\""); + } + + @Test + public void testFormParameterHasDefaultValue() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.setOpenAPI(openAPI); + + Schema requestBodySchema = ModelUtils.getSchemaFromRequestBody(openAPI.getPaths().get("/fake").getGet().getRequestBody()); + CodegenParameter codegenParameter = codegen.fromFormProperty("enum_form_string", (Schema) requestBodySchema.getProperties().get("enum_form_string"), new HashSet()); + + Assert.assertEquals(codegenParameter.defaultValue, "-efg"); + } + + @Test + public void testExample1() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + + Operation operation = openAPI.getPaths().get("/example1/singular").getGet(); + CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); + + Assert.assertEquals(codegenParameter.example, "example1 value"); + + Operation operation2 = openAPI.getPaths().get("/example1/plural").getGet(); + CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); + + Assert.assertEquals(codegenParameter2.example, "An example1 value"); + } + + @Test + public void testExample2() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + + Operation operation = openAPI.getPaths().get("/example2/singular").getGet(); + CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); + + Assert.assertEquals(codegenParameter.example, "example2 value"); + } + + @Test + public void testExample3() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + + Operation operation = openAPI.getPaths().get("/example3/singular").getGet(); + CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); + + Assert.assertEquals(codegenParameter.example, "example3: parameter value"); + + Operation operation2 = openAPI.getPaths().get("/example3/plural").getGet(); + CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); + + Assert.assertEquals(codegenParameter2.example, "example3: parameter value"); + } + + @Test + public void testExample4() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + + Operation operation = openAPI.getPaths().get("/example4/singular").getPost(); + CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter, operation.getRequestBody()); + + Assert.assertEquals(codegenParameter.example, "example4 value"); + + Operation operation2 = openAPI.getPaths().get("/example4/plural").getPost(); + CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter2, operation2.getRequestBody()); + + Assert.assertEquals(codegenParameter2.example, "An example4 value"); } } From d8c422398e3ed86e88319ae2031149fc89236f5f Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 1 Jun 2020 00:25:37 -0700 Subject: [PATCH 09/12] [python-experimental] Quicken package loading (#6437) * apis and models contains all apis and models, omits loading them in the package namespace * Runs git add -a and commits it * Fixes test_outer_enum.py * Fixes test_fruit.py * Updates test_fruit and test_mammal * Fixes test_parent_pet * Updates test_discard_unknown_properties.py * Updates test_deserialization.py * Updates v2 docs md files for apis + the readme * Fixes v2 tests * v2 doc updates * Updates v3 docs * Reverts python_doc_auth_partial.mustache * Adds sys to v3 tests * Adds FILES update Co-authored-by: Justin Black --- .../PythonClientExperimentalCodegen.java | 15 +- .../README_common.mustache | 39 +++- .../python-experimental/__init__api.mustache | 3 + .../python-experimental/__init__apis.mustache | 19 ++ .../__init__model.mustache | 8 +- .../__init__models.mustache | 18 ++ .../__init__package.mustache | 17 +- .../api_doc_example.mustache | 6 +- .../python-experimental/api_test.mustache | 36 +++ .../python-experimental/model_test.mustache | 10 +- .../.openapi-generator/FILES | 126 ++++++----- .../petstore/python-experimental/README.md | 27 ++- .../docs/AnotherFakeApi.md | 6 +- .../python-experimental/docs/FakeApi.md | 66 ++++-- .../docs/FakeClassnameTags123Api.md | 6 +- .../python-experimental/docs/PetApi.md | 38 +++- .../python-experimental/docs/StoreApi.md | 16 +- .../python-experimental/docs/UserApi.md | 37 ++- .../petstore_api/__init__.py | 75 +------ .../petstore_api/api/another_fake_api.py | 2 +- .../petstore_api/api/fake_api.py | 14 +- .../api/fake_classname_tags_123_api.py | 2 +- .../petstore_api/api/pet_api.py | 4 +- .../petstore_api/api/store_api.py | 2 +- .../petstore_api/api/user_api.py | 2 +- .../petstore_api/apis/__init__.py | 20 ++ .../petstore_api/model/__init__.py | 5 + .../additional_properties_any_type.py | 0 .../additional_properties_array.py | 0 .../additional_properties_boolean.py | 0 .../additional_properties_class.py | 0 .../additional_properties_integer.py | 0 .../additional_properties_number.py | 0 .../additional_properties_object.py | 0 .../additional_properties_string.py | 0 .../petstore_api/{models => model}/animal.py | 8 +- .../{models => model}/api_response.py | 0 .../array_of_array_of_number_only.py | 0 .../{models => model}/array_of_number_only.py | 0 .../petstore_api/model}/array_test.py | 4 +- .../{models => model}/capitalization.py | 0 .../petstore_api/{models => model}/cat.py | 8 +- .../{models => model}/cat_all_of.py | 0 .../{models => model}/category.py | 0 .../petstore_api/{models => model}/child.py | 8 +- .../{models => model}/child_all_of.py | 0 .../{models => model}/child_cat.py | 8 +- .../{models => model}/child_cat_all_of.py | 0 .../{models => model}/child_dog.py | 8 +- .../{models => model}/child_dog_all_of.py | 0 .../{models => model}/child_lizard.py | 8 +- .../{models => model}/child_lizard_all_of.py | 0 .../{models => model}/class_model.py | 0 .../petstore_api/{models => model}/client.py | 0 .../petstore_api/{models => model}/dog.py | 8 +- .../{models => model}/dog_all_of.py | 0 .../{models => model}/enum_arrays.py | 0 .../{models => model}/enum_class.py | 0 .../{models => model}/enum_test.py | 4 +- .../petstore_api/{models => model}/file.py | 0 .../model}/file_schema_test_class.py | 4 +- .../{models => model}/format_test.py | 0 .../{models => model}/grandparent.py | 0 .../{models => model}/grandparent_animal.py | 16 +- .../{models => model}/has_only_read_only.py | 0 .../petstore_api/{models => model}/list.py | 0 .../{models => model}/map_test.py | 4 +- ...perties_and_additional_properties_class.py | 4 +- .../{models => model}/model200_response.py | 0 .../{models => model}/model_return.py | 0 .../petstore_api/{models => model}/name.py | 0 .../{models => model}/number_only.py | 0 .../petstore_api/{models => model}/order.py | 0 .../{models => model}/outer_composite.py | 4 +- .../{models => model}/outer_enum.py | 0 .../{models => model}/outer_number.py | 0 .../petstore_api/{models => model}/parent.py | 8 +- .../{models => model}/parent_all_of.py | 0 .../{models => model}/parent_pet.py | 16 +- .../petstore_api/model}/pet.py | 8 +- .../petstore_api/{models => model}/player.py | 0 .../{models => model}/read_only_first.py | 0 .../{models => model}/special_model_name.py | 0 .../{models => model}/string_boolean_map.py | 0 .../petstore_api/{models => model}/tag.py | 0 .../{models => model}/type_holder_default.py | 0 .../{models => model}/type_holder_example.py | 0 .../petstore_api/{models => model}/user.py | 0 .../{models => model}/xml_item.py | 0 .../petstore_api/models/__init__.py | 80 ++++++- .../test_additional_properties_any_type.py | 9 +- .../test/test_additional_properties_array.py | 13 +- .../test_additional_properties_boolean.py | 10 +- .../test/test_additional_properties_class.py | 9 +- .../test_additional_properties_integer.py | 10 +- .../test/test_additional_properties_number.py | 11 +- .../test/test_additional_properties_object.py | 13 +- .../test/test_additional_properties_string.py | 10 +- .../python-experimental/test/test_animal.py | 19 +- .../test/test_another_fake_api.py | 9 +- .../test/test_api_response.py | 9 +- .../test_array_of_array_of_number_only.py | 9 +- .../test/test_array_of_number_only.py | 9 +- .../test/test_array_test.py | 14 +- .../test/test_capitalization.py | 9 +- .../python-experimental/test/test_cat.py | 19 +- .../test/test_cat_all_of.py | 9 +- .../python-experimental/test/test_category.py | 9 +- .../python-experimental/test/test_child.py | 36 +-- .../test/test_child_all_of.py | 5 +- .../test/test_child_cat.py | 15 +- .../test/test_child_cat_all_of.py | 5 +- .../test/test_child_dog.py | 15 +- .../test/test_child_dog_all_of.py | 5 +- .../test/test_child_lizard.py | 15 +- .../test/test_child_lizard_all_of.py | 5 +- .../test/test_class_model.py | 9 +- .../python-experimental/test/test_client.py | 9 +- .../python-experimental/test/test_dog.py | 26 ++- .../test/test_dog_all_of.py | 9 +- .../test/test_enum_arrays.py | 141 +++++++++++- .../test/test_enum_class.py | 9 +- .../test/test_enum_test.py | 14 +- .../python-experimental/test/test_fake_api.py | 23 +- .../test/test_fake_classname_tags_123_api.py | 7 +- .../python-experimental/test/test_file.py | 9 +- .../test/test_file_schema_test_class.py | 14 +- .../test/test_format_test.py | 26 +-- .../test/test_grandparent.py | 5 +- .../test/test_grandparent_animal.py | 25 ++- .../test/test_has_only_read_only.py | 9 +- .../python-experimental/test/test_list.py | 9 +- .../python-experimental/test/test_map_test.py | 104 ++++++++- ...perties_and_additional_properties_class.py | 14 +- .../test/test_model200_response.py | 9 +- .../test/test_model_return.py | 9 +- .../python-experimental/test/test_name.py | 9 +- .../test/test_number_only.py | 9 +- .../python-experimental/test/test_order.py | 16 +- .../test/test_outer_composite.py | 14 +- .../test/test_outer_enum.py | 6 +- .../test/test_outer_number.py | 7 +- .../python-experimental/test/test_parent.py | 15 +- .../test/test_parent_all_of.py | 5 +- .../test/test_parent_pet.py | 25 ++- .../python-experimental/test/test_pet.py | 68 +++++- .../python-experimental/test/test_pet_api.py | 14 +- .../python-experimental/test/test_player.py | 11 +- .../test/test_read_only_first.py | 9 +- .../test/test_special_model_name.py | 9 +- .../test/test_store_api.py | 5 +- .../test/test_string_boolean_map.py | 7 +- .../python-experimental/test/test_tag.py | 9 +- .../test/test_type_holder_default.py | 7 +- .../test/test_type_holder_example.py | 9 +- .../python-experimental/test/test_user.py | 9 +- .../python-experimental/test/test_user_api.py | 5 +- .../python-experimental/test/test_xml_item.py | 9 +- .../tests/test_api_client.py | 14 +- .../tests/test_api_exception.py | 19 +- .../tests/test_deserialization.py | 89 ++++---- .../tests/test_enum_arrays.py | 155 ------------- .../tests/test_map_test.py | 117 ---------- .../tests/test_order_model.py | 27 --- .../python-experimental/tests/test_pet_api.py | 24 +- .../tests/test_pet_model.py | 69 ------ .../tests/test_store_api.py | 4 +- .../.openapi-generator/FILES | 166 +++++++------- .../petstore/python-experimental/README.md | 27 ++- .../docs/AnotherFakeApi.md | 6 +- .../python-experimental/docs/DefaultApi.md | 4 +- .../python-experimental/docs/FakeApi.md | 55 +++-- .../docs/FakeClassnameTags123Api.md | 6 +- .../python-experimental/docs/PetApi.md | 38 +++- .../python-experimental/docs/StoreApi.md | 16 +- .../python-experimental/docs/UserApi.md | 37 ++- .../petstore_api/__init__.py | 96 +------- .../petstore_api/api/another_fake_api.py | 2 +- .../petstore_api/api/default_api.py | 2 +- .../petstore_api/api/fake_api.py | 10 +- .../api/fake_classname_tags_123_api.py | 2 +- .../petstore_api/api/pet_api.py | 4 +- .../petstore_api/api/store_api.py | 2 +- .../petstore_api/api/user_api.py | 2 +- .../petstore_api/apis/__init__.py | 21 ++ .../petstore_api/model/__init__.py | 5 + .../additional_properties_class.py | 0 .../petstore_api/{models => model}/address.py | 0 .../petstore_api/{models => model}/animal.py | 8 +- .../{models => model}/api_response.py | 0 .../petstore_api/{models => model}/apple.py | 0 .../{models => model}/apple_req.py | 0 .../array_of_array_of_number_only.py | 0 .../{models => model}/array_of_number_only.py | 0 .../petstore_api/model}/array_test.py | 4 +- .../petstore_api/{models => model}/banana.py | 0 .../{models => model}/banana_req.py | 0 .../{models => model}/basque_pig.py | 0 .../{models => model}/capitalization.py | 0 .../petstore_api/{models => model}/cat.py | 12 +- .../{models => model}/cat_all_of.py | 0 .../{models => model}/category.py | 0 .../{models => model}/child_cat.py | 8 +- .../{models => model}/child_cat_all_of.py | 0 .../{models => model}/class_model.py | 0 .../petstore_api/{models => model}/client.py | 0 .../complex_quadrilateral.py | 8 +- .../{models => model}/danish_pig.py | 0 .../petstore_api/{models => model}/dog.py | 8 +- .../{models => model}/dog_all_of.py | 0 .../petstore_api/{models => model}/drawing.py | 16 +- .../{models => model}/enum_arrays.py | 0 .../{models => model}/enum_class.py | 0 .../{models => model}/enum_test.py | 16 +- .../{models => model}/equilateral_triangle.py | 8 +- .../petstore_api/{models => model}/file.py | 0 .../model}/file_schema_test_class.py | 4 +- .../petstore_api/{models => model}/foo.py | 0 .../{models => model}/format_test.py | 0 .../petstore_api/{models => model}/fruit.py | 8 +- .../{models => model}/fruit_req.py | 8 +- .../{models => model}/gm_fruit.py | 8 +- .../{models => model}/grandparent_animal.py | 8 +- .../{models => model}/has_only_read_only.py | 0 .../{models => model}/health_check_result.py | 0 .../{models => model}/inline_object.py | 0 .../{models => model}/inline_object1.py | 0 .../{models => model}/inline_object2.py | 0 .../{models => model}/inline_object3.py | 0 .../{models => model}/inline_object4.py | 0 .../{models => model}/inline_object5.py | 0 .../inline_response_default.py | 4 +- .../{models => model}/isosceles_triangle.py | 8 +- .../petstore_api/{models => model}/list.py | 0 .../petstore_api/{models => model}/mammal.py | 12 +- .../{models => model}/map_test.py | 4 +- ...perties_and_additional_properties_class.py | 4 +- .../{models => model}/model200_response.py | 0 .../{models => model}/model_return.py | 0 .../petstore_api/{models => model}/name.py | 0 .../{models => model}/nullable_class.py | 0 .../{models => model}/nullable_shape.py | 8 +- .../{models => model}/number_only.py | 0 .../petstore_api/{models => model}/order.py | 0 .../{models => model}/outer_composite.py | 0 .../{models => model}/outer_enum.py | 0 .../outer_enum_default_value.py | 0 .../{models => model}/outer_enum_integer.py | 0 .../outer_enum_integer_default_value.py | 0 .../{models => model}/parent_pet.py | 8 +- .../petstore_api/model}/pet.py | 8 +- .../petstore_api/{models => model}/pig.py | 8 +- .../{models => model}/quadrilateral.py | 8 +- .../quadrilateral_interface.py | 0 .../{models => model}/read_only_first.py | 0 .../{models => model}/scalene_triangle.py | 8 +- .../petstore_api/{models => model}/shape.py | 8 +- .../{models => model}/shape_interface.py | 0 .../{models => model}/shape_or_null.py | 8 +- .../{models => model}/simple_quadrilateral.py | 8 +- .../{models => model}/special_model_name.py | 0 .../{models => model}/string_boolean_map.py | 0 .../petstore_api/{models => model}/tag.py | 0 .../{models => model}/triangle.py | 12 +- .../{models => model}/triangle_interface.py | 0 .../petstore_api/{models => model}/user.py | 0 .../petstore_api/{models => model}/whale.py | 0 .../petstore_api/{models => model}/zebra.py | 0 .../petstore_api/models/__init__.py | 100 ++++++++- .../petstore_api/models/gm_mammal.py | 212 ------------------ .../test/test_additional_properties_class.py | 5 +- .../python-experimental/test/test_address.py | 5 +- .../python-experimental/test/test_animal.py | 15 +- .../test/test_another_fake_api.py | 3 +- .../test/test_api_response.py | 5 +- .../python-experimental/test/test_apple.py | 5 +- .../test/test_apple_req.py | 5 +- .../test_array_of_array_of_number_only.py | 5 +- .../test/test_array_of_number_only.py | 5 +- .../test/test_array_test.py | 10 +- .../python-experimental/test/test_banana.py | 5 +- .../test/test_banana_req.py | 5 +- .../test/test_basque_pig.py | 5 +- .../test/test_capitalization.py | 5 +- .../python-experimental/test/test_cat.py | 20 +- .../test/test_cat_all_of.py | 5 +- .../python-experimental/test/test_category.py | 5 +- .../test/test_child_cat.py | 15 +- .../test/test_child_cat_all_of.py | 5 +- .../test/test_class_model.py | 5 +- .../python-experimental/test/test_client.py | 5 +- .../test/test_complex_quadrilateral.py | 15 +- .../test/test_danish_pig.py | 5 +- .../test/test_default_api.py | 3 +- .../python-experimental/test/test_dog.py | 15 +- .../test/test_dog_all_of.py | 5 +- .../python-experimental/test/test_drawing.py | 83 ++++--- .../test/test_enum_arrays.py | 5 +- .../test/test_enum_class.py | 5 +- .../test/test_enum_test.py | 25 ++- .../test/test_equilateral_triangle.py | 15 +- .../python-experimental/test/test_fake_api.py | 3 +- .../test/test_fake_classname_tags_123_api.py | 3 +- .../python-experimental/test/test_file.py | 5 +- .../test/test_file_schema_test_class.py | 10 +- .../python-experimental/test/test_foo.py | 5 +- .../test/test_format_test.py | 5 +- .../python-experimental/test/test_fruit.py | 41 ++-- .../test/test_fruit_req.py | 29 ++- .../python-experimental/test/test_gm_fruit.py | 33 ++- .../test/test_grandparent_animal.py | 15 +- .../test/test_has_only_read_only.py | 5 +- .../test/test_health_check_result.py | 5 +- .../test/test_inline_object.py | 5 +- .../test/test_inline_object1.py | 5 +- .../test/test_inline_object2.py | 5 +- .../test/test_inline_object3.py | 5 +- .../test/test_inline_object4.py | 5 +- .../test/test_inline_object5.py | 5 +- .../test/test_inline_response_default.py | 10 +- .../test/test_isosceles_triangle.py | 15 +- .../python-experimental/test/test_list.py | 5 +- .../python-experimental/test/test_mammal.py | 18 +- .../python-experimental/test/test_map_test.py | 10 +- ...perties_and_additional_properties_class.py | 10 +- .../test/test_model200_response.py | 5 +- .../test/test_model_return.py | 5 +- .../python-experimental/test/test_name.py | 5 +- .../test/test_nullable_class.py | 5 +- .../test/test_nullable_shape.py | 15 +- .../test/test_number_only.py | 5 +- .../python-experimental/test/test_order.py | 5 +- .../test/test_outer_composite.py | 5 +- .../test/test_outer_enum.py | 12 +- .../test/test_outer_enum_default_value.py | 5 +- .../test/test_outer_enum_integer.py | 5 +- .../test_outer_enum_integer_default_value.py | 5 +- .../test/test_parent_pet.py | 18 +- .../python-experimental/test/test_pet.py | 15 +- .../python-experimental/test/test_pet_api.py | 3 +- .../python-experimental/test/test_pig.py | 15 +- .../test/test_quadrilateral.py | 21 +- .../test/test_quadrilateral_interface.py | 5 +- .../test/test_read_only_first.py | 5 +- .../test/test_scalene_triangle.py | 15 +- .../python-experimental/test/test_shape.py | 67 +++--- .../test/test_shape_interface.py | 5 +- .../test/test_shape_or_null.py | 15 +- .../test/test_simple_quadrilateral.py | 15 +- .../test/test_special_model_name.py | 5 +- .../test/test_store_api.py | 3 +- .../test/test_string_boolean_map.py | 5 +- .../python-experimental/test/test_tag.py | 3 +- .../python-experimental/test/test_triangle.py | 30 ++- .../test/test_triangle_interface.py | 5 +- .../python-experimental/test/test_user.py | 5 +- .../python-experimental/test/test_user_api.py | 3 +- .../python-experimental/test/test_whale.py | 5 +- .../python-experimental/test/test_zebra.py | 5 +- .../tests/test_api_validation.py | 19 +- .../tests/test_deserialization.py | 70 +++--- .../tests/test_discard_unknown_properties.py | 24 +- .../tests/test_http_signature.py | 18 +- 363 files changed, 2503 insertions(+), 2005 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/__init__apis.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache create mode 100644 samples/client/petstore/python-experimental/petstore_api/apis/__init__.py create mode 100644 samples/client/petstore/python-experimental/petstore_api/model/__init__.py rename samples/client/petstore/python-experimental/petstore_api/{models => model}/additional_properties_any_type.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/additional_properties_array.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/additional_properties_boolean.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/additional_properties_class.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/additional_properties_integer.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/additional_properties_number.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/additional_properties_object.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/additional_properties_string.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/animal.py (97%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/api_response.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/array_of_array_of_number_only.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/array_of_number_only.py (100%) rename samples/{openapi3/client/petstore/python-experimental/petstore_api/models => client/petstore/python-experimental/petstore_api/model}/array_test.py (98%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/capitalization.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/cat.py (98%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/cat_all_of.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/category.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/child.py (98%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/child_all_of.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/child_cat.py (97%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/child_cat_all_of.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/child_dog.py (97%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/child_dog_all_of.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/child_lizard.py (97%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/child_lizard_all_of.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/class_model.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/client.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/dog.py (98%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/dog_all_of.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/enum_arrays.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/enum_class.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/enum_test.py (98%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/file.py (100%) rename samples/{openapi3/client/petstore/python-experimental/petstore_api/models => client/petstore/python-experimental/petstore_api/model}/file_schema_test_class.py (98%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/format_test.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/grandparent.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/grandparent_animal.py (95%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/has_only_read_only.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/list.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/map_test.py (98%) rename samples/{openapi3/client/petstore/python-experimental/petstore_api/models => client/petstore/python-experimental/petstore_api/model}/mixed_properties_and_additional_properties_class.py (98%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/model200_response.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/model_return.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/name.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/number_only.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/order.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/outer_composite.py (98%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/outer_enum.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/outer_number.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/parent.py (97%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/parent_all_of.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/parent_pet.py (96%) rename samples/{openapi3/client/petstore/python-experimental/petstore_api/models => client/petstore/python-experimental/petstore_api/model}/pet.py (97%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/player.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/read_only_first.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/special_model_name.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/string_boolean_map.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/tag.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/type_holder_default.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/type_holder_example.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/user.py (100%) rename samples/client/petstore/python-experimental/petstore_api/{models => model}/xml_item.py (100%) delete mode 100644 samples/client/petstore/python-experimental/tests/test_enum_arrays.py delete mode 100644 samples/client/petstore/python-experimental/tests/test_map_test.py delete mode 100644 samples/client/petstore/python-experimental/tests/test_order_model.py delete mode 100644 samples/client/petstore/python-experimental/tests/test_pet_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/__init__.py rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/additional_properties_class.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/address.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/animal.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/api_response.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/apple.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/apple_req.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/array_of_array_of_number_only.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/array_of_number_only.py (100%) rename samples/{client/petstore/python-experimental/petstore_api/models => openapi3/client/petstore/python-experimental/petstore_api/model}/array_test.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/banana.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/banana_req.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/basque_pig.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/capitalization.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/cat.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/cat_all_of.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/category.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/child_cat.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/child_cat_all_of.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/class_model.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/client.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/complex_quadrilateral.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/danish_pig.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/dog.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/dog_all_of.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/drawing.py (95%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/enum_arrays.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/enum_class.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/enum_test.py (95%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/equilateral_triangle.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/file.py (100%) rename samples/{client/petstore/python-experimental/petstore_api/models => openapi3/client/petstore/python-experimental/petstore_api/model}/file_schema_test_class.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/foo.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/format_test.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/fruit.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/fruit_req.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/gm_fruit.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/grandparent_animal.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/has_only_read_only.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/health_check_result.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/inline_object.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/inline_object1.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/inline_object2.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/inline_object3.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/inline_object4.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/inline_object5.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/inline_response_default.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/isosceles_triangle.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/list.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/mammal.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/map_test.py (98%) rename samples/{client/petstore/python-experimental/petstore_api/models => openapi3/client/petstore/python-experimental/petstore_api/model}/mixed_properties_and_additional_properties_class.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/model200_response.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/model_return.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/name.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/nullable_class.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/nullable_shape.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/number_only.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/order.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/outer_composite.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/outer_enum.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/outer_enum_default_value.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/outer_enum_integer.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/outer_enum_integer_default_value.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/parent_pet.py (97%) rename samples/{client/petstore/python-experimental/petstore_api/models => openapi3/client/petstore/python-experimental/petstore_api/model}/pet.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/pig.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/quadrilateral.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/quadrilateral_interface.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/read_only_first.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/scalene_triangle.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/shape.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/shape_interface.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/shape_or_null.py (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/simple_quadrilateral.py (97%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/special_model_name.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/string_boolean_map.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/tag.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/triangle.py (96%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/triangle_interface.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/user.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/whale.py (100%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/{models => model}/zebra.py (100%) delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_mammal.py diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 5b7138c0686c..384960012385 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -97,6 +97,9 @@ public PythonClientExperimentalCodegen() { apiDocTemplateFiles.remove("api_doc.mustache"); apiDocTemplateFiles.put("python-experimental/api_doc.mustache", ".md"); + apiTestTemplateFiles.remove("api_test.mustache", ".py"); + apiTestTemplateFiles.put("python-experimental/api_test.mustache", ".py"); + modelDocTemplateFiles.remove("model_doc.mustache"); modelDocTemplateFiles.put("python-experimental/model_doc.mustache", ".md"); @@ -123,6 +126,7 @@ public void processOpts() { this.setLegacyDiscriminatorBehavior(false); super.processOpts(); + modelPackage = packageName + "." + "model"; supportingFiles.remove(new SupportingFile("api_client.mustache", packagePath(), "api_client.py")); supportingFiles.add(new SupportingFile("python-experimental/api_client.mustache", packagePath(), "api_client.py")); @@ -130,11 +134,14 @@ public void processOpts() { supportingFiles.add(new SupportingFile("python-experimental/model_utils.mustache", packagePath(), "model_utils.py")); supportingFiles.remove(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + "models", "__init__.py")); - supportingFiles.add(new SupportingFile("python-experimental/__init__model.mustache", packagePath() + File.separatorChar + "models", "__init__.py")); + supportingFiles.add(new SupportingFile("python-experimental/__init__model.mustache", packagePath() + File.separatorChar + "model", "__init__.py")); supportingFiles.remove(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py")); supportingFiles.add(new SupportingFile("python-experimental/__init__package.mustache", packagePath(), "__init__.py")); + // add the models and apis folders + supportingFiles.add(new SupportingFile("python-experimental/__init__models.mustache", packagePath() + File.separatorChar + "models", "__init__.py")); + supportingFiles.add(new SupportingFile("python-experimental/__init__apis.mustache", packagePath() + File.separatorChar + "apis", "__init__.py")); // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. Map securitySchemeMap = openAPI != null ? @@ -518,9 +525,9 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S // set the example value if (modelProp.isEnum) { String value = modelProp._enum.get(0).toString(); - result.example = this.packageName + "." + result.baseType + "(" + toEnumValue(value, simpleDataType) + ")"; + result.example = result.dataType + "(" + toEnumValue(value, simpleDataType) + ")"; } else { - result.example = this.packageName + "." + result.baseType + "(" + result.example + ")"; + result.example = result.dataType + "(" + result.example + ")"; } } else if (!result.isPrimitiveType) { // fix the baseType for the api docs so the .md link to the class's documentation file is correct @@ -1064,7 +1071,7 @@ public void setParameterExampleValue(CodegenParameter p) { example = "'" + escapeText(example) + "'"; } else if (!languageSpecificPrimitives.contains(type)) { // type is a model class, e.g. user.User - example = this.packageName + "." + getPythonClassName(type) + "()"; + example = type + "()"; } else { LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue"); } diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index 7d9811fdfb85..0f6dcb41d6f6 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -4,13 +4,22 @@ from __future__ import print_function import time import {{{packageName}}} from pprint import pprint -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +{{#apiInfo}} +{{#apis}} +{{#-first}} +from {{apiPackage}} import {{classVarName}} +{{#imports}} +{{{import}}} +{{/imports}} +{{#operations}} +{{#operation}} +{{#-first}} {{> python_doc_auth_partial}} # Enter a context with an instance of the API client with {{{packageName}}}.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = {{{packageName}}}.{{{classname}}}(api_client) + api_instance = {{classVarName}}.{{{classname}}}(api_client) {{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} {{/allParams}} @@ -20,7 +29,12 @@ with {{{packageName}}}.ApiClient(configuration) as api_client: pprint(api_response){{/returnType}} except {{{packageName}}}.ApiException as e: print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) - {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +{{/-first}} +{{/operation}} +{{/operations}} +{{/-first}} +{{/apis}} +{{/apiInfo}} ``` ## Documentation for API Endpoints @@ -77,3 +91,22 @@ Class | Method | HTTP request | Description {{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} {{/hasMore}}{{/apis}}{{/apiInfo}} + +## Notes for Large OpenAPI documents +If the OpenAPI document is large, imports in {{{packageName}}}.apis and {{{packageName}}}.models may fail with a +RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: + +Solution 1: +Use specific imports for apis and models like: +- `from {{{packageName}}}.api.default_api import DefaultApi` +- `from {{{packageName}}}.model.pet import Pet` + +Solution 1: +Before importing the package, adjust the maximum recursion limit as shown below: +``` +import sys +sys.setrecursionlimit(1500) +import {{{packageName}}} +from {{{packageName}}}.apis import * +from {{{packageName}}}.models import * +``` diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache new file mode 100644 index 000000000000..d37ee6c78b29 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache @@ -0,0 +1,3 @@ +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all models from one package, import them with +# from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__apis.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__apis.mustache new file mode 100644 index 000000000000..b5b7065e1ed2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__apis.mustache @@ -0,0 +1,19 @@ +# coding: utf-8 + +# flake8: noqa + +# import all apis into this package +# if you have many ampis here with many many models used in each api this may +# raise a RecursionError +# to avoid this, import only the api that you directly need like: +# from {{packagename}}.api.pet_api import PetApi +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +# import apis into api package +{{#apiInfo}} +{{#apis}} +from {{apiPackage}}.{{classVarName}} import {{classname}} +{{/apis}} +{{/apiInfo}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__model.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__model.mustache index ca86cb8a6249..cfe32b784926 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__model.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__model.mustache @@ -1,7 +1,5 @@ -# coding: utf-8 - -# flake8: noqa -{{>partial_header}} - # we can not import model classes here because that would create a circular # reference which would not work in python2 +# do not import all models into this module because that uses a lot of memory and stack frames +# if you need the ability to import all models from one package, import them with +# from {{packageName}.models import ModelA, ModelB diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache new file mode 100644 index 000000000000..abe69dc03504 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache @@ -0,0 +1,18 @@ +# coding: utf-8 + +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from {{modelPackage}}.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +{{#models}} +{{#model}} +from {{modelPackage}}.{{classFilename}} import {{unescapedDescription}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache index 1d74d016ab47..a949d5085067 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache @@ -8,13 +8,6 @@ from __future__ import absolute_import __version__ = "{{packageVersion}}" -# import apis into sdk package -{{#apiInfo}} -{{#apis}} -from {{apiPackage}}.{{classVarName}} import {{classname}} -{{/apis}} -{{/apiInfo}} - # import ApiClient from {{packageName}}.api_client import ApiClient @@ -26,14 +19,8 @@ from {{packageName}}.signing import HttpSigningConfiguration # import exceptions from {{packageName}}.exceptions import OpenApiException +from {{packageName}}.exceptions import ApiAttributeError from {{packageName}}.exceptions import ApiTypeError from {{packageName}}.exceptions import ApiValueError from {{packageName}}.exceptions import ApiKeyError -from {{packageName}}.exceptions import ApiException - -# import models into sdk package -{{#models}} -{{#model}} -from {{modelPackage}}.{{classFilename}} import {{unescapedDescription}} -{{/model}} -{{/models}} +from {{packageName}}.exceptions import ApiException \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache index ae7b8a697970..23cf85e9dffa 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache @@ -2,6 +2,10 @@ from __future__ import print_function import time import {{{packageName}}} +from {{apiPackage}} import {{classVarName}} +{{#imports}} +{{{.}}} +{{/imports}} from pprint import pprint {{> python_doc_auth_partial}} # Enter a context with an instance of the API client @@ -12,7 +16,7 @@ with {{{packageName}}}.ApiClient(configuration) as api_client: with {{{packageName}}}.ApiClient() as api_client: {{/hasAuthMethods}} # Create an instance of the API class - api_instance = {{{packageName}}}.{{{classname}}}(api_client) + api_instance = {{classVarName}}.{{{classname}}}(api_client) {{#requiredParams}}{{^defaultValue}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}} {{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} {{/optionalParams}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache new file mode 100644 index 000000000000..e04b32f96edb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache @@ -0,0 +1,36 @@ +# coding: utf-8 + +{{>partial_header}} + +from __future__ import absolute_import + +import unittest + +import {{packageName}} +from {{apiPackage}}.{{classVarName}} import {{classname}} # noqa: E501 + + +class {{#operations}}Test{{classname}}(unittest.TestCase): + """{{classname}} unit test stubs""" + + def setUp(self): + self.api = {{classname}}() # noqa: E501 + + def tearDown(self): + pass + + {{#operation}} + def test_{{operationId}}(self): + """Test case for {{{operationId}}} + +{{#summary}} + {{{summary}}} # noqa: E501 +{{/summary}} + """ + pass + + {{/operation}} +{{/operations}} + +if __name__ == '__main__': + unittest.main() diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache index 4fd1263b5f28..5b9a91d2d073 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache @@ -3,12 +3,16 @@ {{>partial_header}} from __future__ import absolute_import - +import sys import unittest +import {{packageName}} {{#models}} {{#model}} -import {{packageName}} +{{#imports}} +{{{.}}} +{{/imports}} +from {{modelPackage}}.{{classFilename}} import {{unescapedDescription}} class Test{{unescapedDescription}}(unittest.TestCase): @@ -23,7 +27,7 @@ class Test{{unescapedDescription}}(unittest.TestCase): def test{{unescapedDescription}}(self): """Test {{unescapedDescription}}""" # FIXME: construct object with mandatory attributes with example values - # model = {{packageName}}.{{unescapedDescription}}() # noqa: E501 + # model = {{unescapedDescription}}() # noqa: E501 pass {{/model}} diff --git a/samples/client/petstore/python-experimental/.openapi-generator/FILES b/samples/client/petstore/python-experimental/.openapi-generator/FILES index e855d6b1ef4e..d282130ffbc0 100644 --- a/samples/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/client/petstore/python-experimental/.openapi-generator/FILES @@ -80,72 +80,74 @@ petstore_api/api/pet_api.py petstore_api/api/store_api.py petstore_api/api/user_api.py petstore_api/api_client.py +petstore_api/apis/__init__.py petstore_api/configuration.py petstore_api/exceptions.py +petstore_api/model/__init__.py +petstore_api/model/additional_properties_any_type.py +petstore_api/model/additional_properties_array.py +petstore_api/model/additional_properties_boolean.py +petstore_api/model/additional_properties_class.py +petstore_api/model/additional_properties_integer.py +petstore_api/model/additional_properties_number.py +petstore_api/model/additional_properties_object.py +petstore_api/model/additional_properties_string.py +petstore_api/model/animal.py +petstore_api/model/api_response.py +petstore_api/model/array_of_array_of_number_only.py +petstore_api/model/array_of_number_only.py +petstore_api/model/array_test.py +petstore_api/model/capitalization.py +petstore_api/model/cat.py +petstore_api/model/cat_all_of.py +petstore_api/model/category.py +petstore_api/model/child.py +petstore_api/model/child_all_of.py +petstore_api/model/child_cat.py +petstore_api/model/child_cat_all_of.py +petstore_api/model/child_dog.py +petstore_api/model/child_dog_all_of.py +petstore_api/model/child_lizard.py +petstore_api/model/child_lizard_all_of.py +petstore_api/model/class_model.py +petstore_api/model/client.py +petstore_api/model/dog.py +petstore_api/model/dog_all_of.py +petstore_api/model/enum_arrays.py +petstore_api/model/enum_class.py +petstore_api/model/enum_test.py +petstore_api/model/file.py +petstore_api/model/file_schema_test_class.py +petstore_api/model/format_test.py +petstore_api/model/grandparent.py +petstore_api/model/grandparent_animal.py +petstore_api/model/has_only_read_only.py +petstore_api/model/list.py +petstore_api/model/map_test.py +petstore_api/model/mixed_properties_and_additional_properties_class.py +petstore_api/model/model200_response.py +petstore_api/model/model_return.py +petstore_api/model/name.py +petstore_api/model/number_only.py +petstore_api/model/order.py +petstore_api/model/outer_composite.py +petstore_api/model/outer_enum.py +petstore_api/model/outer_number.py +petstore_api/model/parent.py +petstore_api/model/parent_all_of.py +petstore_api/model/parent_pet.py +petstore_api/model/pet.py +petstore_api/model/player.py +petstore_api/model/read_only_first.py +petstore_api/model/special_model_name.py +petstore_api/model/string_boolean_map.py +petstore_api/model/tag.py +petstore_api/model/type_holder_default.py +petstore_api/model/type_holder_example.py +petstore_api/model/user.py +petstore_api/model/xml_item.py petstore_api/model_utils.py petstore_api/models/__init__.py -petstore_api/models/additional_properties_any_type.py -petstore_api/models/additional_properties_array.py -petstore_api/models/additional_properties_boolean.py -petstore_api/models/additional_properties_class.py -petstore_api/models/additional_properties_integer.py -petstore_api/models/additional_properties_number.py -petstore_api/models/additional_properties_object.py -petstore_api/models/additional_properties_string.py -petstore_api/models/animal.py -petstore_api/models/api_response.py -petstore_api/models/array_of_array_of_number_only.py -petstore_api/models/array_of_number_only.py -petstore_api/models/array_test.py -petstore_api/models/capitalization.py -petstore_api/models/cat.py -petstore_api/models/cat_all_of.py -petstore_api/models/category.py -petstore_api/models/child.py -petstore_api/models/child_all_of.py -petstore_api/models/child_cat.py -petstore_api/models/child_cat_all_of.py -petstore_api/models/child_dog.py -petstore_api/models/child_dog_all_of.py -petstore_api/models/child_lizard.py -petstore_api/models/child_lizard_all_of.py -petstore_api/models/class_model.py -petstore_api/models/client.py -petstore_api/models/dog.py -petstore_api/models/dog_all_of.py -petstore_api/models/enum_arrays.py -petstore_api/models/enum_class.py -petstore_api/models/enum_test.py -petstore_api/models/file.py -petstore_api/models/file_schema_test_class.py -petstore_api/models/format_test.py -petstore_api/models/grandparent.py -petstore_api/models/grandparent_animal.py -petstore_api/models/has_only_read_only.py -petstore_api/models/list.py -petstore_api/models/map_test.py -petstore_api/models/mixed_properties_and_additional_properties_class.py -petstore_api/models/model200_response.py -petstore_api/models/model_return.py -petstore_api/models/name.py -petstore_api/models/number_only.py -petstore_api/models/order.py -petstore_api/models/outer_composite.py -petstore_api/models/outer_enum.py -petstore_api/models/outer_number.py -petstore_api/models/parent.py -petstore_api/models/parent_all_of.py -petstore_api/models/parent_pet.py -petstore_api/models/pet.py -petstore_api/models/player.py -petstore_api/models/read_only_first.py -petstore_api/models/special_model_name.py -petstore_api/models/string_boolean_map.py -petstore_api/models/tag.py -petstore_api/models/type_holder_default.py -petstore_api/models/type_holder_example.py -petstore_api/models/user.py -petstore_api/models/xml_item.py petstore_api/rest.py requirements.txt setup.cfg diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index 81b680fa57b3..d6b85d02a55a 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -50,7 +50,8 @@ from __future__ import print_function import time import petstore_api from pprint import pprint - +from petstore_api.api import another_fake_api +from petstore_api.model import client # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. configuration = petstore_api.Configuration( @@ -62,8 +63,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - body = petstore_api.Client() # client.Client | client model + api_instance = another_fake_api.AnotherFakeApi(api_client) + body = client.Client() # client.Client | client model try: # To test special tags @@ -71,7 +72,6 @@ with petstore_api.ApiClient(configuration) as api_client: pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) - ``` ## Documentation for API Endpoints @@ -223,3 +223,22 @@ Class | Method | HTTP request | Description +## Notes for Large OpenAPI documents +If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a +RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: + +Solution 1: +Use specific imports for apis and models like: +- `from petstore_api.api.default_api import DefaultApi` +- `from petstore_api.model.pet import Pet` + +Solution 1: +Before importing the package, adjust the maximum recursion limit as shown below: +``` +import sys +sys.setrecursionlimit(1500) +import petstore_api +from petstore_api.apis import * +from petstore_api.models import * +``` + diff --git a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md index 83a89addfaee..8b7a61109454 100644 --- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -20,6 +20,8 @@ To test special tags and operation ID starting with number from __future__ import print_function import time import petstore_api +from petstore_api.api import another_fake_api +from petstore_api.model import client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -31,8 +33,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - body = petstore_api.Client() # client.Client | client model + api_instance = another_fake_api.AnotherFakeApi(api_client) + body = client.Client() # client.Client | client model # example passing only required values which don't have defaults set try: diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index de9a3fd1a4fb..7f813d160f77 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -34,6 +34,8 @@ this route creates an XmlItem from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import xml_item from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -45,8 +47,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - xml_item = petstore_api.XmlItem() # xml_item.XmlItem | XmlItem Body + api_instance = fake_api.FakeApi(api_client) + xml_item = xml_item.XmlItem() # xml_item.XmlItem | XmlItem Body # example passing only required values which don't have defaults set try: @@ -95,6 +97,7 @@ Test serialization of outer boolean types from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -106,7 +109,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) body = True # bool | Input boolean as post body (optional) # example passing only required values which don't have defaults set @@ -157,6 +160,8 @@ Test serialization of object with outer number type from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import outer_composite from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -168,8 +173,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) + api_instance = fake_api.FakeApi(api_client) + body = outer_composite.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) # example passing only required values which don't have defaults set # and optional values @@ -219,6 +224,8 @@ Test serialization of outer enum from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import outer_enum from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -230,8 +237,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.OuterEnum("placed") # outer_enum.OuterEnum | Input enum as post body (optional) + api_instance = fake_api.FakeApi(api_client) + body = outer_enum.OuterEnum("placed") # outer_enum.OuterEnum | Input enum as post body (optional) # example passing only required values which don't have defaults set # and optional values @@ -281,6 +288,8 @@ Test serialization of outer number types from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import outer_number from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -292,8 +301,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.OuterNumber(3.4) # outer_number.OuterNumber | Input number as post body (optional) + api_instance = fake_api.FakeApi(api_client) + body = outer_number.OuterNumber(3.4) # outer_number.OuterNumber | Input number as post body (optional) # example passing only required values which don't have defaults set # and optional values @@ -343,6 +352,7 @@ Test serialization of outer string types from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -354,7 +364,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) body = 'body_example' # str | Input string as post body (optional) # example passing only required values which don't have defaults set @@ -405,6 +415,8 @@ For this test, the body for this request much reference a schema named `File`. from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import file_schema_test_class from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -416,8 +428,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | + api_instance = fake_api.FakeApi(api_client) + body = file_schema_test_class.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | # example passing only required values which don't have defaults set try: @@ -463,6 +475,8 @@ No authorization required from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -474,9 +488,9 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) query = 'query_example' # str | - body = petstore_api.User() # user.User | + body = user.User() # user.User | # example passing only required values which don't have defaults set try: @@ -525,6 +539,8 @@ To test \"client\" model from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -536,8 +552,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - body = petstore_api.Client() # client.Client | client model + api_instance = fake_api.FakeApi(api_client) + body = client.Client() # client.Client | client model # example passing only required values which don't have defaults set try: @@ -587,6 +603,7 @@ This route has required values with enums of 1 from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -598,7 +615,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) # example passing only required values which don't have defaults set try: @@ -651,6 +668,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -672,7 +690,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) number = 3.4 # float | None double = 3.4 # float | None pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None @@ -757,6 +775,7 @@ To test enum parameters from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -768,7 +787,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' enum_query_string_array = ['enum_query_string_array_example'] # [str] | Query parameter enum test (string array) (optional) @@ -834,6 +853,7 @@ Fake endpoint to test group parameters (optional) from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -845,7 +865,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) required_string_group = 56 # int | Required String in group parameters required_boolean_group = True # bool | Required Boolean in group parameters required_int64_group = 56 # int | Required Integer in group parameters @@ -911,6 +931,7 @@ test inline additionalProperties from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -922,7 +943,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) param = {'key': 'param_example'} # {str: (str,)} | request body # example passing only required values which don't have defaults set @@ -970,6 +991,7 @@ test json serialization of form data from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -981,7 +1003,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index c10f9f37e164..6cc246194992 100644 --- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -21,6 +21,8 @@ To test class name in snake case from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_classname_tags_123_api +from petstore_api.model import client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -46,8 +48,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeClassnameTags123Api(api_client) - body = petstore_api.Client() # client.Client | client model + api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) + body = client.Client() # client.Client | client model # example passing only required values which don't have defaults set try: diff --git a/samples/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-experimental/docs/PetApi.md index d7192a2dd5f3..20b56372d833 100644 --- a/samples/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/client/petstore/python-experimental/docs/PetApi.md @@ -27,6 +27,8 @@ Add a new pet to the store from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -48,8 +50,8 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - body = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + api_instance = pet_api.PetApi(api_client) + body = pet.Pet() # pet.Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: @@ -98,6 +100,7 @@ Deletes a pet from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -119,7 +122,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) pet_id = 56 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) @@ -181,6 +184,8 @@ Multiple status values can be provided with comma separated strings from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -202,7 +207,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) status = ['status_example'] # [str] | Status values that need to be considered for filter # example passing only required values which don't have defaults set @@ -255,6 +260,8 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -276,7 +283,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) tags = ['tags_example'] # [str] | Tags to filter by # example passing only required values which don't have defaults set @@ -329,6 +336,8 @@ Returns a single pet from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -354,7 +363,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) pet_id = 56 # int | ID of pet to return # example passing only required values which don't have defaults set @@ -406,6 +415,8 @@ Update an existing pet from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -427,8 +438,8 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - body = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + api_instance = pet_api.PetApi(api_client) + body = pet.Pet() # pet.Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: @@ -479,6 +490,7 @@ Updates a pet in the store with form data from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -500,7 +512,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) pet_id = 56 # int | ID of pet that needs to be updated name = 'name_example' # str | Updated name of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional) @@ -561,6 +573,8 @@ uploads an image from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import api_response from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -582,7 +596,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) pet_id = 56 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) file = open('/path/to/file', 'rb') # file_type | file to upload (optional) @@ -647,6 +661,8 @@ uploads an image (required) from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import api_response from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -668,7 +684,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) pet_id = 56 # int | ID of pet to update required_file = open('/path/to/file', 'rb') # file_type | file to upload additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-experimental/docs/StoreApi.md index b4492962d69c..36e72b2ac4f1 100644 --- a/samples/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/client/petstore/python-experimental/docs/StoreApi.md @@ -23,6 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non from __future__ import print_function import time import petstore_api +from petstore_api.api import store_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -34,7 +35,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) + api_instance = store_api.StoreApi(api_client) order_id = 'order_id_example' # str | ID of the order that needs to be deleted # example passing only required values which don't have defaults set @@ -86,6 +87,7 @@ Returns a map of status codes to quantities from __future__ import print_function import time import petstore_api +from petstore_api.api import store_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -111,7 +113,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) + api_instance = store_api.StoreApi(api_client) # example, this endpoint has no required or optional parameters try: @@ -158,6 +160,8 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge from __future__ import print_function import time import petstore_api +from petstore_api.api import store_api +from petstore_api.model import order from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -169,7 +173,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) + api_instance = store_api.StoreApi(api_client) order_id = 56 # int | ID of pet that needs to be fetched # example passing only required values which don't have defaults set @@ -220,6 +224,8 @@ Place an order for a pet from __future__ import print_function import time import petstore_api +from petstore_api.api import store_api +from petstore_api.model import order from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -231,8 +237,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - body = petstore_api.Order() # order.Order | order placed for purchasing the pet + api_instance = store_api.StoreApi(api_client) + body = order.Order() # order.Order | order placed for purchasing the pet # example passing only required values which don't have defaults set try: diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-experimental/docs/UserApi.md index b02b92afbf74..4727961273c1 100644 --- a/samples/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/client/petstore/python-experimental/docs/UserApi.md @@ -27,6 +27,8 @@ This can only be done by the logged in user. from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -38,8 +40,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = petstore_api.User() # user.User | Created user object + api_instance = user_api.UserApi(api_client) + body = user.User() # user.User | Created user object # example passing only required values which don't have defaults set try: @@ -86,6 +88,8 @@ Creates list of users with given input array from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -97,8 +101,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = [petstore_api.User()] # [user.User] | List of user object + api_instance = user_api.UserApi(api_client) + body = [user.User()] # [user.User] | List of user object # example passing only required values which don't have defaults set try: @@ -145,6 +149,8 @@ Creates list of users with given input array from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -156,8 +162,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - body = [petstore_api.User()] # [user.User] | List of user object + api_instance = user_api.UserApi(api_client) + body = [user.User()] # [user.User] | List of user object # example passing only required values which don't have defaults set try: @@ -206,6 +212,7 @@ This can only be done by the logged in user. from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -217,7 +224,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) + api_instance = user_api.UserApi(api_client) username = 'username_example' # str | The name that needs to be deleted # example passing only required values which don't have defaults set @@ -266,6 +273,8 @@ Get user by user name from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -277,7 +286,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) + api_instance = user_api.UserApi(api_client) username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. # example passing only required values which don't have defaults set @@ -328,6 +337,7 @@ Logs user into the system from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -339,7 +349,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) + api_instance = user_api.UserApi(api_client) username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text @@ -391,6 +401,7 @@ Logs out current logged in user session from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -402,7 +413,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) + api_instance = user_api.UserApi(api_client) # example, this endpoint has no required or optional parameters try: @@ -448,6 +459,8 @@ This can only be done by the logged in user. from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -459,9 +472,9 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) + api_instance = user_api.UserApi(api_client) username = 'username_example' # str | name that need to be deleted - body = petstore_api.User() # user.User | Updated user object + body = user.User() # user.User | Updated user object # example passing only required values which don't have defaults set try: diff --git a/samples/client/petstore/python-experimental/petstore_api/__init__.py b/samples/client/petstore/python-experimental/petstore_api/__init__.py index 445bf2409aee..4af4353187f6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/client/petstore/python-experimental/petstore_api/__init__.py @@ -16,14 +16,6 @@ __version__ = "1.0.0" -# import apis into sdk package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi - # import ApiClient from petstore_api.api_client import ApiClient @@ -32,71 +24,8 @@ # import exceptions from petstore_api.exceptions import OpenApiException +from petstore_api.exceptions import ApiAttributeError from petstore_api.exceptions import ApiTypeError from petstore_api.exceptions import ApiValueError from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiException - -# import models into sdk package -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject -from petstore_api.models.additional_properties_string import AdditionalPropertiesString -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.child import Child -from petstore_api.models.child_all_of import ChildAllOf -from petstore_api.models.child_cat import ChildCat -from petstore_api.models.child_cat_all_of import ChildCatAllOf -from petstore_api.models.child_dog import ChildDog -from petstore_api.models.child_dog_all_of import ChildDogAllOf -from petstore_api.models.child_lizard import ChildLizard -from petstore_api.models.child_lizard_all_of import ChildLizardAllOf -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.format_test import FormatTest -from petstore_api.models.grandparent import Grandparent -from petstore_api.models.grandparent_animal import GrandparentAnimal -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.outer_number import OuterNumber -from petstore_api.models.parent import Parent -from petstore_api.models.parent_all_of import ParentAllOf -from petstore_api.models.parent_pet import ParentPet -from petstore_api.models.pet import Pet -from petstore_api.models.player import Player -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.string_boolean_map import StringBooleanMap -from petstore_api.models.tag import Tag -from petstore_api.models.type_holder_default import TypeHolderDefault -from petstore_api.models.type_holder_example import TypeHolderExample -from petstore_api.models.user import User -from petstore_api.models.xml_item import XmlItem +from petstore_api.exceptions import ApiException \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index b7ea5e549329..3f277311b8fb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -34,7 +34,7 @@ str, validate_and_convert_types ) -from petstore_api.models import client +from petstore_api.model import client class AnotherFakeApi(object): diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index e97902bb9a2b..a05c8e947b31 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -34,13 +34,13 @@ str, validate_and_convert_types ) -from petstore_api.models import xml_item -from petstore_api.models import outer_composite -from petstore_api.models import outer_enum -from petstore_api.models import outer_number -from petstore_api.models import file_schema_test_class -from petstore_api.models import user -from petstore_api.models import client +from petstore_api.model import xml_item +from petstore_api.model import outer_composite +from petstore_api.model import outer_enum +from petstore_api.model import outer_number +from petstore_api.model import file_schema_test_class +from petstore_api.model import user +from petstore_api.model import client class FakeApi(object): diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index 863e64beb0b5..be57432ae68d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -34,7 +34,7 @@ str, validate_and_convert_types ) -from petstore_api.models import client +from petstore_api.model import client class FakeClassnameTags123Api(object): diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py index 3d289a669882..6ec1e6d5c5cd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -34,8 +34,8 @@ str, validate_and_convert_types ) -from petstore_api.models import pet -from petstore_api.models import api_response +from petstore_api.model import pet +from petstore_api.model import api_response class PetApi(object): diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py index bcae5aab2a60..e612a43704f2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -34,7 +34,7 @@ str, validate_and_convert_types ) -from petstore_api.models import order +from petstore_api.model import order class StoreApi(object): diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py index 1362c5e31105..930ae821f2cb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -34,7 +34,7 @@ str, validate_and_convert_types ) -from petstore_api.models import user +from petstore_api.model import user class UserApi(object): diff --git a/samples/client/petstore/python-experimental/petstore_api/apis/__init__.py b/samples/client/petstore/python-experimental/petstore_api/apis/__init__.py new file mode 100644 index 000000000000..f309caa3e651 --- /dev/null +++ b/samples/client/petstore/python-experimental/petstore_api/apis/__init__.py @@ -0,0 +1,20 @@ +# coding: utf-8 + +# flake8: noqa + +# import all apis into this package +# if you have many ampis here with many many models used in each api this may +# raise a RecursionError +# to avoid this, import only the api that you directly need like: +# from .api.pet_api import PetApi +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +# import apis into api package +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi diff --git a/samples/client/petstore/python-experimental/petstore_api/model/__init__.py b/samples/client/petstore/python-experimental/petstore_api/model/__init__.py new file mode 100644 index 000000000000..cfe32b784926 --- /dev/null +++ b/samples/client/petstore/python-experimental/petstore_api/model/__init__.py @@ -0,0 +1,5 @@ +# we can not import model classes here because that would create a circular +# reference which would not work in python2 +# do not import all models into this module because that uses a lot of memory and stack frames +# if you need the ability to import all models from one package, import them with +# from {{packageName}.models import ModelA, ModelB diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py rename to samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py rename to samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py rename to samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py rename to samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py rename to samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py rename to samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py rename to samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py rename to samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/model/animal.py similarity index 97% rename from samples/client/petstore/python-experimental/petstore_api/models/animal.py rename to samples/client/petstore/python-experimental/petstore_api/model/animal.py index 641c9c16e279..7ba62dad1622 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/animal.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import cat + from petstore_api.model import cat except ImportError: cat = sys.modules[ - 'petstore_api.models.cat'] + 'petstore_api.model.cat'] try: - from petstore_api.models import dog + from petstore_api.model import dog except ImportError: dog = sys.modules[ - 'petstore_api.models.dog'] + 'petstore_api.model.dog'] class Animal(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/client/petstore/python-experimental/petstore_api/model/api_response.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/api_response.py rename to samples/client/petstore/python-experimental/petstore_api/model/api_response.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py rename to samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py rename to samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/client/petstore/python-experimental/petstore_api/model/array_test.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py rename to samples/client/petstore/python-experimental/petstore_api/model/array_test.py index 0eed8d054611..e2bc76832b27 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import read_only_first + from petstore_api.model import read_only_first except ImportError: read_only_first = sys.modules[ - 'petstore_api.models.read_only_first'] + 'petstore_api.model.read_only_first'] class ArrayTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/capitalization.py rename to samples/client/petstore/python-experimental/petstore_api/model/capitalization.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/model/cat.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/models/cat.py rename to samples/client/petstore/python-experimental/petstore_api/model/cat.py index 9620612169bf..b40a97dbab9a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/cat.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import animal + from petstore_api.model import animal except ImportError: animal = sys.modules[ - 'petstore_api.models.animal'] + 'petstore_api.model.animal'] try: - from petstore_api.models import cat_all_of + from petstore_api.model import cat_all_of except ImportError: cat_all_of = sys.modules[ - 'petstore_api.models.cat_all_of'] + 'petstore_api.model.cat_all_of'] class Cat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py rename to samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/category.py b/samples/client/petstore/python-experimental/petstore_api/model/category.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/category.py rename to samples/client/petstore/python-experimental/petstore_api/model/category.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child.py b/samples/client/petstore/python-experimental/petstore_api/model/child.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/models/child.py rename to samples/client/petstore/python-experimental/petstore_api/model/child.py index 7be69a7d5280..37c138d6a488 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import child_all_of + from petstore_api.model import child_all_of except ImportError: child_all_of = sys.modules[ - 'petstore_api.models.child_all_of'] + 'petstore_api.model.child_all_of'] try: - from petstore_api.models import parent + from petstore_api.model import parent except ImportError: parent = sys.modules[ - 'petstore_api.models.parent'] + 'petstore_api.model.parent'] class Child(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/child_all_of.py rename to samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py similarity index 97% rename from samples/client/petstore/python-experimental/petstore_api/models/child_cat.py rename to samples/client/petstore/python-experimental/petstore_api/model/child_cat.py index 873c3bc76cf7..6d42f11a18ff 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import child_cat_all_of + from petstore_api.model import child_cat_all_of except ImportError: child_cat_all_of = sys.modules[ - 'petstore_api.models.child_cat_all_of'] + 'petstore_api.model.child_cat_all_of'] try: - from petstore_api.models import parent_pet + from petstore_api.model import parent_pet except ImportError: parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + 'petstore_api.model.parent_pet'] class ChildCat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/child_cat_all_of.py rename to samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py similarity index 97% rename from samples/client/petstore/python-experimental/petstore_api/models/child_dog.py rename to samples/client/petstore/python-experimental/petstore_api/model/child_dog.py index a49f042cf74d..b7a93571a6a0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import child_dog_all_of + from petstore_api.model import child_dog_all_of except ImportError: child_dog_all_of = sys.modules[ - 'petstore_api.models.child_dog_all_of'] + 'petstore_api.model.child_dog_all_of'] try: - from petstore_api.models import parent_pet + from petstore_api.model import parent_pet except ImportError: parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + 'petstore_api.model.parent_pet'] class ChildDog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/child_dog_all_of.py rename to samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py similarity index 97% rename from samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py rename to samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py index 0f11243a2493..978fea14a183 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import child_lizard_all_of + from petstore_api.model import child_lizard_all_of except ImportError: child_lizard_all_of = sys.modules[ - 'petstore_api.models.child_lizard_all_of'] + 'petstore_api.model.child_lizard_all_of'] try: - from petstore_api.models import parent_pet + from petstore_api.model import parent_pet except ImportError: parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + 'petstore_api.model.parent_pet'] class ChildLizard(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/child_lizard_all_of.py rename to samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/client/petstore/python-experimental/petstore_api/model/class_model.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/class_model.py rename to samples/client/petstore/python-experimental/petstore_api/model/class_model.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/client.py b/samples/client/petstore/python-experimental/petstore_api/model/client.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/client.py rename to samples/client/petstore/python-experimental/petstore_api/model/client.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/model/dog.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/models/dog.py rename to samples/client/petstore/python-experimental/petstore_api/model/dog.py index f9b93eebc78f..547eba90c2b1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/dog.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import animal + from petstore_api.model import animal except ImportError: animal = sys.modules[ - 'petstore_api.models.animal'] + 'petstore_api.model.animal'] try: - from petstore_api.models import dog_all_of + from petstore_api.model import dog_all_of except ImportError: dog_all_of = sys.modules[ - 'petstore_api.models.dog_all_of'] + 'petstore_api.model.dog_all_of'] class Dog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py rename to samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py rename to samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/enum_class.py rename to samples/client/petstore/python-experimental/petstore_api/model/enum_class.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/models/enum_test.py rename to samples/client/petstore/python-experimental/petstore_api/model/enum_test.py index 71cf60fd4823..bc0d1025261f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import outer_enum + from petstore_api.model import outer_enum except ImportError: outer_enum = sys.modules[ - 'petstore_api.models.outer_enum'] + 'petstore_api.model.outer_enum'] class EnumTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file.py b/samples/client/petstore/python-experimental/petstore_api/model/file.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/file.py rename to samples/client/petstore/python-experimental/petstore_api/model/file.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py rename to samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 79e5638ccc94..0a9471e9e420 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import file + from petstore_api.model import file except ImportError: file = sys.modules[ - 'petstore_api.models.file'] + 'petstore_api.model.file'] class FileSchemaTestClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/client/petstore/python-experimental/petstore_api/model/format_test.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/format_test.py rename to samples/client/petstore/python-experimental/petstore_api/model/format_test.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/grandparent.py b/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/grandparent.py rename to samples/client/petstore/python-experimental/petstore_api/model/grandparent.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py b/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py similarity index 95% rename from samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py rename to samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index 54dc5be641d7..81947e1c497d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -34,25 +34,25 @@ validate_get_composed_info, ) try: - from petstore_api.models import child_cat + from petstore_api.model import child_cat except ImportError: child_cat = sys.modules[ - 'petstore_api.models.child_cat'] + 'petstore_api.model.child_cat'] try: - from petstore_api.models import child_dog + from petstore_api.model import child_dog except ImportError: child_dog = sys.modules[ - 'petstore_api.models.child_dog'] + 'petstore_api.model.child_dog'] try: - from petstore_api.models import child_lizard + from petstore_api.model import child_lizard except ImportError: child_lizard = sys.modules[ - 'petstore_api.models.child_lizard'] + 'petstore_api.model.child_lizard'] try: - from petstore_api.models import parent_pet + from petstore_api.model import parent_pet except ImportError: parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + 'petstore_api.model.parent_pet'] class GrandparentAnimal(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py rename to samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/list.py b/samples/client/petstore/python-experimental/petstore_api/model/list.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/list.py rename to samples/client/petstore/python-experimental/petstore_api/model/list.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/client/petstore/python-experimental/petstore_api/model/map_test.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/models/map_test.py rename to samples/client/petstore/python-experimental/petstore_api/model/map_test.py index 45be8a1fecfd..a22af06ce4fd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import string_boolean_map + from petstore_api.model import string_boolean_map except ImportError: string_boolean_map = sys.modules[ - 'petstore_api.models.string_boolean_map'] + 'petstore_api.model.string_boolean_map'] class MapTest(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py rename to samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index 0e584ebd43e9..a0fcac2eb019 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import animal + from petstore_api.model import animal except ImportError: animal = sys.modules[ - 'petstore_api.models.animal'] + 'petstore_api.model.animal'] class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/model200_response.py rename to samples/client/petstore/python-experimental/petstore_api/model/model200_response.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/client/petstore/python-experimental/petstore_api/model/model_return.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/model_return.py rename to samples/client/petstore/python-experimental/petstore_api/model/model_return.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/name.py b/samples/client/petstore/python-experimental/petstore_api/model/name.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/name.py rename to samples/client/petstore/python-experimental/petstore_api/model/name.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/number_only.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/number_only.py rename to samples/client/petstore/python-experimental/petstore_api/model/number_only.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/order.py b/samples/client/petstore/python-experimental/petstore_api/model/order.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/order.py rename to samples/client/petstore/python-experimental/petstore_api/model/order.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/model/outer_composite.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py rename to samples/client/petstore/python-experimental/petstore_api/model/outer_composite.py index a64cbe37592c..5614b9afe422 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/outer_composite.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import outer_number + from petstore_api.model import outer_number except ImportError: outer_number = sys.modules[ - 'petstore_api.models.outer_number'] + 'petstore_api.model.outer_number'] class OuterComposite(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/client/petstore/python-experimental/petstore_api/model/outer_enum.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py rename to samples/client/petstore/python-experimental/petstore_api/model/outer_enum.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_number.py b/samples/client/petstore/python-experimental/petstore_api/model/outer_number.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/outer_number.py rename to samples/client/petstore/python-experimental/petstore_api/model/outer_number.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent.py b/samples/client/petstore/python-experimental/petstore_api/model/parent.py similarity index 97% rename from samples/client/petstore/python-experimental/petstore_api/models/parent.py rename to samples/client/petstore/python-experimental/petstore_api/model/parent.py index 5d33beb6979d..a855a3ffd014 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import grandparent + from petstore_api.model import grandparent except ImportError: grandparent = sys.modules[ - 'petstore_api.models.grandparent'] + 'petstore_api.model.grandparent'] try: - from petstore_api.models import parent_all_of + from petstore_api.model import parent_all_of except ImportError: parent_all_of = sys.modules[ - 'petstore_api.models.parent_all_of'] + 'petstore_api.model.parent_all_of'] class Parent(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/parent_all_of.py rename to samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py similarity index 96% rename from samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py rename to samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py index 4635ac947806..0b0b30c656f5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -34,25 +34,25 @@ validate_get_composed_info, ) try: - from petstore_api.models import child_cat + from petstore_api.model import child_cat except ImportError: child_cat = sys.modules[ - 'petstore_api.models.child_cat'] + 'petstore_api.model.child_cat'] try: - from petstore_api.models import child_dog + from petstore_api.model import child_dog except ImportError: child_dog = sys.modules[ - 'petstore_api.models.child_dog'] + 'petstore_api.model.child_dog'] try: - from petstore_api.models import child_lizard + from petstore_api.model import child_lizard except ImportError: child_lizard = sys.modules[ - 'petstore_api.models.child_lizard'] + 'petstore_api.model.child_lizard'] try: - from petstore_api.models import grandparent_animal + from petstore_api.model import grandparent_animal except ImportError: grandparent_animal = sys.modules[ - 'petstore_api.models.grandparent_animal'] + 'petstore_api.model.grandparent_animal'] class ParentPet(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/client/petstore/python-experimental/petstore_api/model/pet.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py rename to samples/client/petstore/python-experimental/petstore_api/model/pet.py index c93acd53c96c..742d7cdf04a8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/pet.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import category + from petstore_api.model import category except ImportError: category = sys.modules[ - 'petstore_api.models.category'] + 'petstore_api.model.category'] try: - from petstore_api.models import tag + from petstore_api.model import tag except ImportError: tag = sys.modules[ - 'petstore_api.models.tag'] + 'petstore_api.model.tag'] class Pet(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/player.py b/samples/client/petstore/python-experimental/petstore_api/model/player.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/player.py rename to samples/client/petstore/python-experimental/petstore_api/model/player.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py rename to samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py rename to samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py b/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py rename to samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/client/petstore/python-experimental/petstore_api/model/tag.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/tag.py rename to samples/client/petstore/python-experimental/petstore_api/model/tag.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py rename to samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py rename to samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/user.py b/samples/client/petstore/python-experimental/petstore_api/model/user.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/user.py rename to samples/client/petstore/python-experimental/petstore_api/model/user.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py b/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py similarity index 100% rename from samples/client/petstore/python-experimental/petstore_api/models/xml_item.py rename to samples/client/petstore/python-experimental/petstore_api/model/xml_item.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/client/petstore/python-experimental/petstore_api/models/__init__.py index e02c66519259..51bdb1a85a57 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/__init__.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -1,15 +1,75 @@ # coding: utf-8 # flake8: noqa -""" - OpenAPI Petstore - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from petstore_api.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -# we can not import model classes here because that would create a circular -# reference which would not work in python2 +from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType +from petstore_api.model.additional_properties_array import AdditionalPropertiesArray +from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean +from petstore_api.model.additional_properties_class import AdditionalPropertiesClass +from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger +from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber +from petstore_api.model.additional_properties_object import AdditionalPropertiesObject +from petstore_api.model.additional_properties_string import AdditionalPropertiesString +from petstore_api.model.animal import Animal +from petstore_api.model.api_response import ApiResponse +from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.model.array_of_number_only import ArrayOfNumberOnly +from petstore_api.model.array_test import ArrayTest +from petstore_api.model.capitalization import Capitalization +from petstore_api.model.cat import Cat +from petstore_api.model.cat_all_of import CatAllOf +from petstore_api.model.category import Category +from petstore_api.model.child import Child +from petstore_api.model.child_all_of import ChildAllOf +from petstore_api.model.child_cat import ChildCat +from petstore_api.model.child_cat_all_of import ChildCatAllOf +from petstore_api.model.child_dog import ChildDog +from petstore_api.model.child_dog_all_of import ChildDogAllOf +from petstore_api.model.child_lizard import ChildLizard +from petstore_api.model.child_lizard_all_of import ChildLizardAllOf +from petstore_api.model.class_model import ClassModel +from petstore_api.model.client import Client +from petstore_api.model.dog import Dog +from petstore_api.model.dog_all_of import DogAllOf +from petstore_api.model.enum_arrays import EnumArrays +from petstore_api.model.enum_class import EnumClass +from petstore_api.model.enum_test import EnumTest +from petstore_api.model.file import File +from petstore_api.model.file_schema_test_class import FileSchemaTestClass +from petstore_api.model.format_test import FormatTest +from petstore_api.model.grandparent import Grandparent +from petstore_api.model.grandparent_animal import GrandparentAnimal +from petstore_api.model.has_only_read_only import HasOnlyReadOnly +from petstore_api.model.list import List +from petstore_api.model.map_test import MapTest +from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.model.model200_response import Model200Response +from petstore_api.model.model_return import ModelReturn +from petstore_api.model.name import Name +from petstore_api.model.number_only import NumberOnly +from petstore_api.model.order import Order +from petstore_api.model.outer_composite import OuterComposite +from petstore_api.model.outer_enum import OuterEnum +from petstore_api.model.outer_number import OuterNumber +from petstore_api.model.parent import Parent +from petstore_api.model.parent_all_of import ParentAllOf +from petstore_api.model.parent_pet import ParentPet +from petstore_api.model.pet import Pet +from petstore_api.model.player import Player +from petstore_api.model.read_only_first import ReadOnlyFirst +from petstore_api.model.special_model_name import SpecialModelName +from petstore_api.model.string_boolean_map import StringBooleanMap +from petstore_api.model.tag import Tag +from petstore_api.model.type_holder_default import TypeHolderDefault +from petstore_api.model.type_holder_example import TypeHolderExample +from petstore_api.model.user import User +from petstore_api.model.xml_item import XmlItem diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py b/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py index 4b6739a1faf3..ce985f76ed9e 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType class TestAdditionalPropertiesAnyType(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testAdditionalPropertiesAnyType(self): """Test AdditionalPropertiesAnyType""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501 + # model = AdditionalPropertiesAnyType() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py index 6c86292cd4a4..f63ca82f6c22 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py @@ -5,21 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.additional_properties_array import AdditionalPropertiesArray # noqa: E501 -from petstore_api.rest import ApiException -from petstore_api.exceptions import ApiTypeError - -import datetime +from petstore_api.model.additional_properties_array import AdditionalPropertiesArray class TestAdditionalPropertiesArray(unittest.TestCase): @@ -37,6 +33,7 @@ def testAdditionalPropertiesArray(self): model = AdditionalPropertiesArray() # can make one with additional properties + import datetime some_val = [] model = AdditionalPropertiesArray(some_key=some_val) assert model['some_key'] == some_val @@ -45,7 +42,7 @@ def testAdditionalPropertiesArray(self): assert model['some_key'] == some_val # type checking works on additional properties - with self.assertRaises(ApiTypeError) as exc: + with self.assertRaises(petstore_api.ApiTypeError) as exc: model = AdditionalPropertiesArray(some_key='some string') diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py index 33bcfb90bb61..e5a13891c098 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py @@ -5,19 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean # noqa: E501 -from petstore_api.rest import ApiException -from petstore_api.exceptions import ApiTypeError +from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean class TestAdditionalPropertiesBoolean(unittest.TestCase): @@ -39,7 +37,7 @@ def testAdditionalPropertiesBoolean(self): assert model['some_key'] == True # type checking works on additional properties - with self.assertRaises(ApiTypeError) as exc: + with self.assertRaises(petstore_api.ApiTypeError) as exc: model = AdditionalPropertiesBoolean(some_key='True') diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_additional_properties_class.py index fc9df3bbb505..befc14455da2 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.additional_properties_class import AdditionalPropertiesClass class TestAdditionalPropertiesClass(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testAdditionalPropertiesClass(self): """Test AdditionalPropertiesClass""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501 + # model = AdditionalPropertiesClass() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py index 0029cb9c84c5..0e08b8f87706 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py @@ -5,19 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger # noqa: E501 -from petstore_api.rest import ApiException -from petstore_api.exceptions import ApiTypeError +from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger class TestAdditionalPropertiesInteger(unittest.TestCase): @@ -39,7 +37,7 @@ def testAdditionalPropertiesInteger(self): assert model['some_key'] == 3 # type checking works on additional properties - with self.assertRaises(ApiTypeError) as exc: + with self.assertRaises(petstore_api.ApiTypeError) as exc: model = AdditionalPropertiesInteger(some_key=11.3) diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py index 28d0b23377a6..90f4429e989f 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py @@ -5,19 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber # noqa: E501 -from petstore_api.rest import ApiException -from petstore_api.exceptions import ApiTypeError +from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber class TestAdditionalPropertiesNumber(unittest.TestCase): @@ -39,8 +37,9 @@ def testAdditionalPropertiesNumber(self): assert model['some_key'] == 11.3 # type checking works on additional properties - with self.assertRaises(ApiTypeError) as exc: + with self.assertRaises(petstore_api.ApiTypeError) as exc: model = AdditionalPropertiesNumber(some_key=10) + if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py index 3d135116736c..ded4a8e8a124 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py @@ -5,21 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501 -from petstore_api.rest import ApiException -from petstore_api.exceptions import ApiTypeError - -import datetime +from petstore_api.model.additional_properties_object import AdditionalPropertiesObject class TestAdditionalPropertiesObject(unittest.TestCase): @@ -40,12 +36,13 @@ def testAdditionalPropertiesObject(self): some_val = {} model = AdditionalPropertiesObject(some_key=some_val) assert model['some_key'] == some_val + import datetime some_val = {'a': True, 'b': datetime.date(1970,1,1), 'c': datetime.datetime(1970,1,1), 'd': {}, 'e': 3.1, 'f': 1, 'g': [], 'h': 'hello'} model = AdditionalPropertiesObject(some_key=some_val) assert model['some_key'] == some_val # type checking works on additional properties - with self.assertRaises(ApiTypeError) as exc: + with self.assertRaises(petstore_api.ApiTypeError) as exc: model = AdditionalPropertiesObject(some_key='some string') diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py index 0276334ead53..cff2c31921fe 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py @@ -5,19 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.additional_properties_string import AdditionalPropertiesString # noqa: E501 -from petstore_api.rest import ApiException -from petstore_api.exceptions import ApiTypeError +from petstore_api.model.additional_properties_string import AdditionalPropertiesString class TestAdditionalPropertiesString(unittest.TestCase): @@ -39,7 +37,7 @@ def testAdditionalPropertiesString(self): assert model['some_key'] == 'some_val' # type checking works on additional properties - with self.assertRaises(ApiTypeError) as exc: + with self.assertRaises(petstore_api.ApiTypeError) as exc: model = AdditionalPropertiesString(some_key=True) diff --git a/samples/client/petstore/python-experimental/test/test_animal.py b/samples/client/petstore/python-experimental/test/test_animal.py index 179f1fbd0e52..958f303f13e3 100644 --- a/samples/client/petstore/python-experimental/test/test_animal.py +++ b/samples/client/petstore/python-experimental/test/test_animal.py @@ -5,18 +5,27 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.animal import Animal # noqa: E501 -from petstore_api.rest import ApiException +try: + from petstore_api.model import cat +except ImportError: + cat = sys.modules[ + 'petstore_api.model.cat'] +try: + from petstore_api.model import dog +except ImportError: + dog = sys.modules[ + 'petstore_api.model.dog'] +from petstore_api.model.animal import Animal class TestAnimal(unittest.TestCase): @@ -31,7 +40,7 @@ def tearDown(self): def testAnimal(self): """Test Animal""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.animal.Animal() # noqa: E501 + # model = Animal() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/client/petstore/python-experimental/test/test_another_fake_api.py index 4b80dc4eda52..f79966a26961 100644 --- a/samples/client/petstore/python-experimental/test/test_another_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_another_fake_api.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -16,20 +16,19 @@ import petstore_api from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 -from petstore_api.rest import ApiException class TestAnotherFakeApi(unittest.TestCase): """AnotherFakeApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 + self.api = AnotherFakeApi() # noqa: E501 def tearDown(self): pass - def test_test_special_tags(self): - """Test case for test_special_tags + def test_call_123_test_special_tags(self): + """Test case for call_123_test_special_tags To test special tags # noqa: E501 """ diff --git a/samples/client/petstore/python-experimental/test/test_api_response.py b/samples/client/petstore/python-experimental/test/test_api_response.py index 5031b458a0db..9db92633f626 100644 --- a/samples/client/petstore/python-experimental/test/test_api_response.py +++ b/samples/client/petstore/python-experimental/test/test_api_response.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.api_response import ApiResponse # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.api_response import ApiResponse class TestApiResponse(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testApiResponse(self): """Test ApiResponse""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.api_response.ApiResponse() # noqa: E501 + # model = ApiResponse() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py index a02233045421..4980ad17afb5 100644 --- a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly class TestArrayOfArrayOfNumberOnly(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testArrayOfArrayOfNumberOnly(self): """Test ArrayOfArrayOfNumberOnly""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501 + # model = ArrayOfArrayOfNumberOnly() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/client/petstore/python-experimental/test/test_array_of_number_only.py index 1a928bf7d2e0..479c537cada7 100644 --- a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.array_of_number_only import ArrayOfNumberOnly class TestArrayOfNumberOnly(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testArrayOfNumberOnly(self): """Test ArrayOfNumberOnly""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501 + # model = ArrayOfNumberOnly() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_array_test.py b/samples/client/petstore/python-experimental/test/test_array_test.py index c56b77b77ee3..2426b27b7e46 100644 --- a/samples/client/petstore/python-experimental/test/test_array_test.py +++ b/samples/client/petstore/python-experimental/test/test_array_test.py @@ -5,18 +5,22 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.array_test import ArrayTest # noqa: E501 -from petstore_api.rest import ApiException +try: + from petstore_api.model import read_only_first +except ImportError: + read_only_first = sys.modules[ + 'petstore_api.model.read_only_first'] +from petstore_api.model.array_test import ArrayTest class TestArrayTest(unittest.TestCase): @@ -31,7 +35,7 @@ def tearDown(self): def testArrayTest(self): """Test ArrayTest""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_test.ArrayTest() # noqa: E501 + # model = ArrayTest() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_capitalization.py b/samples/client/petstore/python-experimental/test/test_capitalization.py index 2ae7725b3f09..20d2649c01eb 100644 --- a/samples/client/petstore/python-experimental/test/test_capitalization.py +++ b/samples/client/petstore/python-experimental/test/test_capitalization.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.capitalization import Capitalization # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.capitalization import Capitalization class TestCapitalization(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testCapitalization(self): """Test Capitalization""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 + # model = Capitalization() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_cat.py b/samples/client/petstore/python-experimental/test/test_cat.py index 5ebd7908d2db..64b525aaf118 100644 --- a/samples/client/petstore/python-experimental/test/test_cat.py +++ b/samples/client/petstore/python-experimental/test/test_cat.py @@ -5,18 +5,27 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.cat import Cat # noqa: E501 -from petstore_api.rest import ApiException +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +try: + from petstore_api.model import cat_all_of +except ImportError: + cat_all_of = sys.modules[ + 'petstore_api.model.cat_all_of'] +from petstore_api.model.cat import Cat class TestCat(unittest.TestCase): @@ -31,7 +40,7 @@ def tearDown(self): def testCat(self): """Test Cat""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.cat.Cat() # noqa: E501 + # model = Cat() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/client/petstore/python-experimental/test/test_cat_all_of.py index 531443380c6e..a5bb91ac864e 100644 --- a/samples/client/petstore/python-experimental/test/test_cat_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_cat_all_of.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.cat_all_of import CatAllOf # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.cat_all_of import CatAllOf class TestCatAllOf(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testCatAllOf(self): """Test CatAllOf""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501 + # model = CatAllOf() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_category.py b/samples/client/petstore/python-experimental/test/test_category.py index 6a592521281e..59b64e5924a8 100644 --- a/samples/client/petstore/python-experimental/test/test_category.py +++ b/samples/client/petstore/python-experimental/test/test_category.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.category import Category # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.category import Category class TestCategory(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testCategory(self): """Test Category""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.category.Category() # noqa: E501 + # model = Category() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_child.py b/samples/client/petstore/python-experimental/test/test_child.py index 660cfe637d96..51c0bb129d24 100644 --- a/samples/client/petstore/python-experimental/test/test_child.py +++ b/samples/client/petstore/python-experimental/test/test_child.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import child_all_of +except ImportError: + child_all_of = sys.modules[ + 'petstore_api.model.child_all_of'] +try: + from petstore_api.model import parent +except ImportError: + parent = sys.modules[ + 'petstore_api.model.parent'] +from petstore_api.model.child import Child class TestChild(unittest.TestCase): @@ -33,7 +44,7 @@ def testChild(self): radio_waves = True tele_vision = True inter_net = True - child = petstore_api.Child( + child = Child( radio_waves=radio_waves, tele_vision=tele_vision, inter_net=inter_net @@ -64,10 +75,10 @@ def testChild(self): # setting a value that doesn't exist raises an exception # with a key - with self.assertRaises(AttributeError): + with self.assertRaises(petstore_api.ApiAttributeError): child['invalid_variable'] = 'some value' # with setattr - with self.assertRaises(AttributeError): + with self.assertRaises(petstore_api.ApiAttributeError): setattr(child, 'invalid_variable', 'some value') # with hasattr @@ -75,12 +86,12 @@ def testChild(self): # getting a value that doesn't exist raises an exception # with a key - with self.assertRaises(AttributeError): + with self.assertRaises(petstore_api.ApiAttributeError): invalid_variable = child['invalid_variable'] # with getattr self.assertEquals(getattr(child, 'invalid_variable', 'some value'), 'some value') - with self.assertRaises(AttributeError): + with self.assertRaises(petstore_api.ApiAttributeError): invalid_variable = getattr(child, 'invalid_variable') # make sure that the ModelComposed class properties are correct @@ -90,8 +101,8 @@ def testChild(self): { 'anyOf': [], 'allOf': [ - petstore_api.ChildAllOf, - petstore_api.Parent, + child_all_of.ChildAllOf, + parent.Parent, ], 'oneOf': [], } @@ -99,9 +110,9 @@ def testChild(self): # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas() for composed_instance in child._composed_instances: - if composed_instance.__class__ == petstore_api.Parent: + if composed_instance.__class__ == parent.Parent: parent_instance = composed_instance - elif composed_instance.__class__ == petstore_api.ChildAllOf: + elif composed_instance.__class__ == child_all_of.ChildAllOf: child_allof_instance = composed_instance self.assertEqual( child._composed_instances, @@ -132,12 +143,11 @@ def testChild(self): # including extra parameters raises an exception with self.assertRaises(petstore_api.ApiValueError): - child = petstore_api.Child( + child = Child( radio_waves=radio_waves, tele_vision=tele_vision, inter_net=inter_net, - unknown_property='some value' - ) + unknown_property='some value') if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_child_all_of.py b/samples/client/petstore/python-experimental/test/test_child_all_of.py index e3f14035f625..96e479cf0796 100644 --- a/samples/client/petstore/python-experimental/test/test_child_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_all_of.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.child_all_of import ChildAllOf class TestChildAllOf(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testChildAllOf(self): """Test ChildAllOf""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ChildAllOf() # noqa: E501 + # model = ChildAllOf() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_child_cat.py b/samples/client/petstore/python-experimental/test/test_child_cat.py index c42c3b583aae..34c085515a80 100644 --- a/samples/client/petstore/python-experimental/test/test_child_cat.py +++ b/samples/client/petstore/python-experimental/test/test_child_cat.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import child_cat_all_of +except ImportError: + child_cat_all_of = sys.modules[ + 'petstore_api.model.child_cat_all_of'] +try: + from petstore_api.model import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.model.parent_pet'] +from petstore_api.model.child_cat import ChildCat class TestChildCat(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testChildCat(self): """Test ChildCat""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ChildCat() # noqa: E501 + # model = ChildCat() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py b/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py index 3304a81a2321..2a7aab100fbf 100644 --- a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.child_cat_all_of import ChildCatAllOf class TestChildCatAllOf(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testChildCatAllOf(self): """Test ChildCatAllOf""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ChildCatAllOf() # noqa: E501 + # model = ChildCatAllOf() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_child_dog.py b/samples/client/petstore/python-experimental/test/test_child_dog.py index 9c56f27bbc49..dfb09213e40c 100644 --- a/samples/client/petstore/python-experimental/test/test_child_dog.py +++ b/samples/client/petstore/python-experimental/test/test_child_dog.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import child_dog_all_of +except ImportError: + child_dog_all_of = sys.modules[ + 'petstore_api.model.child_dog_all_of'] +try: + from petstore_api.model import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.model.parent_pet'] +from petstore_api.model.child_dog import ChildDog class TestChildDog(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testChildDog(self): """Test ChildDog""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ChildDog() # noqa: E501 + # model = ChildDog() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py b/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py index a9124db412b7..ca75000c650e 100644 --- a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.child_dog_all_of import ChildDogAllOf class TestChildDogAllOf(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testChildDogAllOf(self): """Test ChildDogAllOf""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ChildDogAllOf() # noqa: E501 + # model = ChildDogAllOf() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard.py b/samples/client/petstore/python-experimental/test/test_child_lizard.py index 21ba88480aad..975dc1612a9f 100644 --- a/samples/client/petstore/python-experimental/test/test_child_lizard.py +++ b/samples/client/petstore/python-experimental/test/test_child_lizard.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import child_lizard_all_of +except ImportError: + child_lizard_all_of = sys.modules[ + 'petstore_api.model.child_lizard_all_of'] +try: + from petstore_api.model import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.model.parent_pet'] +from petstore_api.model.child_lizard import ChildLizard class TestChildLizard(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testChildLizard(self): """Test ChildLizard""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ChildLizard() # noqa: E501 + # model = ChildLizard() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py b/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py index 824e376f855b..1b3bf4dba943 100644 --- a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.child_lizard_all_of import ChildLizardAllOf class TestChildLizardAllOf(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testChildLizardAllOf(self): """Test ChildLizardAllOf""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ChildLizardAllOf() # noqa: E501 + # model = ChildLizardAllOf() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_class_model.py b/samples/client/petstore/python-experimental/test/test_class_model.py index 12b7fb99402e..060df39e4b5e 100644 --- a/samples/client/petstore/python-experimental/test/test_class_model.py +++ b/samples/client/petstore/python-experimental/test/test_class_model.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.class_model import ClassModel # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.class_model import ClassModel class TestClassModel(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testClassModel(self): """Test ClassModel""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.class_model.ClassModel() # noqa: E501 + # model = ClassModel() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_client.py b/samples/client/petstore/python-experimental/test/test_client.py index 9e18c4310d96..ab5e3a80d377 100644 --- a/samples/client/petstore/python-experimental/test/test_client.py +++ b/samples/client/petstore/python-experimental/test/test_client.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.client import Client # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.client import Client class TestClient(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testClient(self): """Test Client""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.client.Client() # noqa: E501 + # model = Client() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_dog.py b/samples/client/petstore/python-experimental/test/test_dog.py index 91f9318b9c68..26949b34ae7f 100644 --- a/samples/client/petstore/python-experimental/test/test_dog.py +++ b/samples/client/petstore/python-experimental/test/test_dog.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +try: + from petstore_api.model import dog_all_of +except ImportError: + dog_all_of = sys.modules[ + 'petstore_api.model.dog_all_of'] +from petstore_api.model.dog import Dog class TestDog(unittest.TestCase): @@ -33,7 +44,7 @@ def testDog(self): class_name = 'Dog' color = 'white' breed = 'Jack Russel Terrier' - dog = petstore_api.Dog( + dog = Dog( class_name=class_name, color=color, breed=breed @@ -87,8 +98,8 @@ def testDog(self): { 'anyOf': [], 'allOf': [ - petstore_api.Animal, - petstore_api.DogAllOf, + animal.Animal, + dog_all_of.DogAllOf, ], 'oneOf': [], } @@ -96,9 +107,9 @@ def testDog(self): # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas() for composed_instance in dog._composed_instances: - if composed_instance.__class__ == petstore_api.Animal: + if composed_instance.__class__ == animal.Animal: animal_instance = composed_instance - elif composed_instance.__class__ == petstore_api.DogAllOf: + elif composed_instance.__class__ == dog_all_of.DogAllOf: dog_allof_instance = composed_instance self.assertEqual( dog._composed_instances, @@ -129,13 +140,12 @@ def testDog(self): # including extra parameters raises an exception with self.assertRaises(petstore_api.ApiValueError): - dog = petstore_api.Dog( + dog = Dog( class_name=class_name, color=color, breed=breed, unknown_property='some value' ) - if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/client/petstore/python-experimental/test/test_dog_all_of.py index 3d79f2888c96..7ab4e8ae79d8 100644 --- a/samples/client/petstore/python-experimental/test/test_dog_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_dog_all_of.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.dog_all_of import DogAllOf # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.dog_all_of import DogAllOf class TestDogAllOf(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testDogAllOf(self): """Test DogAllOf""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501 + # model = DogAllOf() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/client/petstore/python-experimental/test/test_enum_arrays.py index be572508ef22..64ad5fd7dc08 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_arrays.py +++ b/samples/client/petstore/python-experimental/test/test_enum_arrays.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.enum_arrays import EnumArrays class TestEnumArrays(unittest.TestCase): @@ -28,12 +27,136 @@ def setUp(self): def tearDown(self): pass - def testEnumArrays(self): - """Test EnumArrays""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501 - pass + def test_enumarrays_init(self): + # + # Check various combinations of valid values. + # + fish_or_crab = EnumArrays(just_symbol=">=") + self.assertEqual(fish_or_crab.just_symbol, ">=") + # if optional property is unset we raise an exception + with self.assertRaises(petstore_api.ApiAttributeError) as exc: + self.assertEqual(fish_or_crab.array_enum, None) + + fish_or_crab = EnumArrays(just_symbol="$", array_enum=["fish"]) + self.assertEqual(fish_or_crab.just_symbol, "$") + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab = EnumArrays(just_symbol=">=", array_enum=["fish"]) + self.assertEqual(fish_or_crab.just_symbol, ">=") + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab = EnumArrays(just_symbol="$", array_enum=["crab"]) + self.assertEqual(fish_or_crab.just_symbol, "$") + self.assertEqual(fish_or_crab.array_enum, ["crab"]) + + + # + # Check if setting invalid values fails + # + with self.assertRaises(petstore_api.ApiValueError) as exc: + fish_or_crab = EnumArrays(just_symbol="<=") + + with self.assertRaises(petstore_api.ApiValueError) as exc: + fish_or_crab = EnumArrays(just_symbol="$", array_enum=["dog"]) + + with self.assertRaises(petstore_api.ApiTypeError) as exc: + fish_or_crab = EnumArrays(just_symbol=["$"], array_enum=["crab"]) + + + def test_enumarrays_setter(self): + + # + # Check various combinations of valid values + # + fish_or_crab = EnumArrays() + + fish_or_crab.just_symbol = ">=" + self.assertEqual(fish_or_crab.just_symbol, ">=") + + fish_or_crab.just_symbol = "$" + self.assertEqual(fish_or_crab.just_symbol, "$") + + fish_or_crab.array_enum = [] + self.assertEqual(fish_or_crab.array_enum, []) + + fish_or_crab.array_enum = ["fish"] + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab.array_enum = ["fish", "fish", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["fish", "fish", "fish"]) + + fish_or_crab.array_enum = ["crab"] + self.assertEqual(fish_or_crab.array_enum, ["crab"]) + + fish_or_crab.array_enum = ["crab", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["crab", "fish"]) + + fish_or_crab.array_enum = ["crab", "fish", "crab", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["crab", "fish", "crab", "fish"]) + + # + # Check if setting invalid values fails + # + fish_or_crab = EnumArrays() + with self.assertRaises(petstore_api.ApiValueError) as exc: + fish_or_crab.just_symbol = "!=" + + with self.assertRaises(petstore_api.ApiTypeError) as exc: + fish_or_crab.just_symbol = ["fish"] + + with self.assertRaises(petstore_api.ApiValueError) as exc: + fish_or_crab.array_enum = ["cat"] + + with self.assertRaises(petstore_api.ApiValueError) as exc: + fish_or_crab.array_enum = ["fish", "crab", "dog"] + + with self.assertRaises(petstore_api.ApiTypeError) as exc: + fish_or_crab.array_enum = "fish" + + + def test_todict(self): + # + # Check if dictionary serialization works + # + dollar_fish_crab_dict = { + 'just_symbol': "$", + 'array_enum': ["fish", "crab"] + } + + dollar_fish_crab = EnumArrays( + just_symbol="$", array_enum=["fish", "crab"]) + + self.assertEqual(dollar_fish_crab_dict, dollar_fish_crab.to_dict()) + + # + # Sanity check for different arrays + # + dollar_crab_fish_dict = { + 'just_symbol': "$", + 'array_enum': ["crab", "fish"] + } + + dollar_fish_crab = EnumArrays( + just_symbol="$", array_enum=["fish", "crab"]) + + self.assertNotEqual(dollar_crab_fish_dict, dollar_fish_crab.to_dict()) + + + def test_equals(self): + # + # Check if object comparison works + # + fish1 = EnumArrays(just_symbol="$", array_enum=["fish"]) + fish2 = EnumArrays(just_symbol="$", array_enum=["fish"]) + self.assertEqual(fish1, fish2) + + fish = EnumArrays(just_symbol="$", array_enum=["fish"]) + crab = EnumArrays(just_symbol="$", array_enum=["crab"]) + self.assertNotEqual(fish, crab) + dollar = EnumArrays(just_symbol="$") + greater = EnumArrays(just_symbol=">=") + self.assertNotEqual(dollar, greater) if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_enum_class.py b/samples/client/petstore/python-experimental/test/test_enum_class.py index 57eb14558a7d..f910231c9d02 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_class.py +++ b/samples/client/petstore/python-experimental/test/test_enum_class.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.enum_class import EnumClass # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.enum_class import EnumClass class TestEnumClass(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testEnumClass(self): """Test EnumClass""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 + # model = EnumClass() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_enum_test.py b/samples/client/petstore/python-experimental/test/test_enum_test.py index ecd43afc709d..0ada34cdc1f2 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_test.py +++ b/samples/client/petstore/python-experimental/test/test_enum_test.py @@ -5,18 +5,22 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.enum_test import EnumTest # noqa: E501 -from petstore_api.rest import ApiException +try: + from petstore_api.model import outer_enum +except ImportError: + outer_enum = sys.modules[ + 'petstore_api.model.outer_enum'] +from petstore_api.model.enum_test import EnumTest class TestEnumTest(unittest.TestCase): @@ -31,7 +35,7 @@ def tearDown(self): def testEnumTest(self): """Test EnumTest""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_test.EnumTest() # noqa: E501 + # model = EnumTest() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_fake_api.py b/samples/client/petstore/python-experimental/test/test_fake_api.py index 7a6f1d6810a0..d55e538b8608 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_api.py @@ -11,24 +11,18 @@ from __future__ import absolute_import -import six import unittest -if six.PY3: - from unittest.mock import patch -else: - from mock import patch import petstore_api from petstore_api.api.fake_api import FakeApi # noqa: E501 -from petstore_api.rest import ApiException class TestFakeApi(unittest.TestCase): """FakeApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 + self.api = FakeApi() # noqa: E501 def tearDown(self): pass @@ -57,18 +51,20 @@ def test_fake_outer_enum_serialize(self): """ # verify that the input and output are type OuterEnum + from petstore_api.model import outer_enum endpoint = self.api.fake_outer_enum_serialize - assert endpoint.openapi_types['body'] == (petstore_api.OuterEnum,) - assert endpoint.settings['response_type'] == (petstore_api.OuterEnum,) + assert endpoint.openapi_types['body'] == (outer_enum.OuterEnum,) + assert endpoint.settings['response_type'] == (outer_enum.OuterEnum,) def test_fake_outer_number_serialize(self): """Test case for fake_outer_number_serialize """ # verify that the input and output are the correct type + from petstore_api.model import outer_number endpoint = self.api.fake_outer_number_serialize - assert endpoint.openapi_types['body'] == (petstore_api.OuterNumber,) - assert endpoint.settings['response_type'] == (petstore_api.OuterNumber,) + assert endpoint.openapi_types['body'] == (outer_number.OuterNumber,) + assert endpoint.settings['response_type'] == (outer_number.OuterNumber,) def test_fake_outer_string_serialize(self): """Test case for fake_outer_string_serialize @@ -101,6 +97,11 @@ def test_test_endpoint_enums_length_one(self): """ # when we omit the required enums of length one, they are still set endpoint = self.api.test_endpoint_enums_length_one + import six + if six.PY3: + from unittest.mock import patch + else: + from mock import patch with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: endpoint() call_with_http_info.assert_called_with( diff --git a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py index 87cac0b9ef85..1ade31405a62 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -5,25 +5,24 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException class TestFakeClassnameTags123Api(unittest.TestCase): """FakeClassnameTags123Api unit test stubs""" def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + self.api = FakeClassnameTags123Api() # noqa: E501 def tearDown(self): pass diff --git a/samples/client/petstore/python-experimental/test/test_file.py b/samples/client/petstore/python-experimental/test/test_file.py index cc32edb7b523..8d60f64e01cc 100644 --- a/samples/client/petstore/python-experimental/test/test_file.py +++ b/samples/client/petstore/python-experimental/test/test_file.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.file import File # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.file import File class TestFile(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testFile(self): """Test File""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.file.File() # noqa: E501 + # model = File() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py index 91e1b6a1c745..9a4f6d38dfef 100644 --- a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -5,18 +5,22 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501 -from petstore_api.rest import ApiException +try: + from petstore_api.model import file +except ImportError: + file = sys.modules[ + 'petstore_api.model.file'] +from petstore_api.model.file_schema_test_class import FileSchemaTestClass class TestFileSchemaTestClass(unittest.TestCase): @@ -31,7 +35,7 @@ def tearDown(self): def testFileSchemaTestClass(self): """Test FileSchemaTestClass""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501 + # model = FileSchemaTestClass() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_format_test.py b/samples/client/petstore/python-experimental/test/test_format_test.py index e7a32e3253ff..ca37b005fd96 100644 --- a/samples/client/petstore/python-experimental/test/test_format_test.py +++ b/samples/client/petstore/python-experimental/test/test_format_test.py @@ -2,26 +2,27 @@ """ OpenAPI Petstore + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - -import datetime +import sys import unittest import petstore_api -from petstore_api.models.format_test import FormatTest # noqa: E501 -from petstore_api import ApiValueError +from petstore_api.model.format_test import FormatTest class TestFormatTest(unittest.TestCase): """FormatTest unit test stubs""" def setUp(self): + import datetime self.required_named_args = dict( number=40.1, byte='what', @@ -37,7 +38,7 @@ def test_integer(self): key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] for key, adder in key_adder_pairs: # value outside the bounds throws an error - with self.assertRaises(ApiValueError): + with self.assertRaises(petstore_api.ApiValueError): keyword_args[var_name] = validations[key] + adder FormatTest(**keyword_args) @@ -54,7 +55,7 @@ def test_int32(self): key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] for key, adder in key_adder_pairs: # value outside the bounds throws an error - with self.assertRaises(ApiValueError): + with self.assertRaises(petstore_api.ApiValueError): keyword_args[var_name] = validations[key] + adder FormatTest(**keyword_args) @@ -71,7 +72,7 @@ def test_number(self): key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] for key, adder in key_adder_pairs: # value outside the bounds throws an error - with self.assertRaises(ApiValueError): + with self.assertRaises(petstore_api.ApiValueError): keyword_args[var_name] = validations[key] + adder FormatTest(**keyword_args) @@ -88,7 +89,7 @@ def test_float(self): key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] for key, adder in key_adder_pairs: # value outside the bounds throws an error - with self.assertRaises(ApiValueError): + with self.assertRaises(petstore_api.ApiValueError): keyword_args[var_name] = validations[key] + adder FormatTest(**keyword_args) @@ -105,7 +106,7 @@ def test_double(self): key_adder_pairs = [('inclusive_maximum', 1), ('inclusive_minimum', -1)] for key, adder in key_adder_pairs: # value outside the bounds throws an error - with self.assertRaises(ApiValueError): + with self.assertRaises(petstore_api.ApiValueError): keyword_args[var_name] = validations[key] + adder FormatTest(**keyword_args) @@ -122,7 +123,7 @@ def test_password(self): key_adder_pairs = [('max_length', 1), ('min_length', -1)] for key, adder in key_adder_pairs: # value outside the bounds throws an error - with self.assertRaises(ApiValueError): + with self.assertRaises(petstore_api.ApiValueError): keyword_args[var_name] = 'a'*(validations[key] + adder) FormatTest(**keyword_args) @@ -139,7 +140,7 @@ def test_string(self): values_invalid = ['abc3', '1', '.', ' ', 'مرحبا', ''] for value_invalid in values_invalid: # invalid values throw exceptions - with self.assertRaises(ApiValueError): + with self.assertRaises(petstore_api.ApiValueError): keyword_args[var_name] = value_invalid FormatTest(**keyword_args) @@ -148,6 +149,5 @@ def test_string(self): keyword_args[var_name] = value_valid assert getattr(FormatTest(**keyword_args), var_name) == value_valid - if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_grandparent.py b/samples/client/petstore/python-experimental/test/test_grandparent.py index 44f594c086e4..2972d01161cd 100644 --- a/samples/client/petstore/python-experimental/test/test_grandparent.py +++ b/samples/client/petstore/python-experimental/test/test_grandparent.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.grandparent import Grandparent class TestGrandparent(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testGrandparent(self): """Test Grandparent""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Grandparent() # noqa: E501 + # model = Grandparent() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py b/samples/client/petstore/python-experimental/test/test_grandparent_animal.py index dc0d300cdaea..cabe4d81f98e 100644 --- a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py +++ b/samples/client/petstore/python-experimental/test/test_grandparent_animal.py @@ -11,10 +11,31 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import child_cat +except ImportError: + child_cat = sys.modules[ + 'petstore_api.model.child_cat'] +try: + from petstore_api.model import child_dog +except ImportError: + child_dog = sys.modules[ + 'petstore_api.model.child_dog'] +try: + from petstore_api.model import child_lizard +except ImportError: + child_lizard = sys.modules[ + 'petstore_api.model.child_lizard'] +try: + from petstore_api.model import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.model.parent_pet'] +from petstore_api.model.grandparent_animal import GrandparentAnimal class TestGrandparentAnimal(unittest.TestCase): @@ -29,7 +50,7 @@ def tearDown(self): def testGrandparentAnimal(self): """Test GrandparentAnimal""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.GrandparentAnimal() # noqa: E501 + # model = GrandparentAnimal() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/client/petstore/python-experimental/test/test_has_only_read_only.py index 2dc052a328a0..9ebd7683b398 100644 --- a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py +++ b/samples/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.has_only_read_only import HasOnlyReadOnly class TestHasOnlyReadOnly(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testHasOnlyReadOnly(self): """Test HasOnlyReadOnly""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501 + # model = HasOnlyReadOnly() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_list.py b/samples/client/petstore/python-experimental/test/test_list.py index a538a6b1ad36..52156adfed2e 100644 --- a/samples/client/petstore/python-experimental/test/test_list.py +++ b/samples/client/petstore/python-experimental/test/test_list.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.list import List # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.list import List class TestList(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testList(self): """Test List""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.list.List() # noqa: E501 + # model = List() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_map_test.py b/samples/client/petstore/python-experimental/test/test_map_test.py index 0ba6481903e6..3feda0f688df 100644 --- a/samples/client/petstore/python-experimental/test/test_map_test.py +++ b/samples/client/petstore/python-experimental/test/test_map_test.py @@ -5,18 +5,22 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.map_test import MapTest # noqa: E501 -from petstore_api.rest import ApiException +try: + from petstore_api.model import string_boolean_map +except ImportError: + string_boolean_map = sys.modules[ + 'petstore_api.model.string_boolean_map'] +from petstore_api.model.map_test import MapTest class TestMapTest(unittest.TestCase): @@ -28,12 +32,94 @@ def setUp(self): def tearDown(self): pass - def testMapTest(self): - """Test MapTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.map_test.MapTest() # noqa: E501 - pass + def test_maptest_init(self): + # + # Test MapTest construction with valid values + # + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_enum_test = MapTest(map_of_enum_string=up_or_low_dict) + + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + + map_of_map_of_strings = { + 'valueDict': up_or_low_dict + } + map_enum_test = MapTest(map_map_of_string=map_of_map_of_strings) + + self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) + + # + # Make sure that the init fails for invalid enum values + # + black_or_white_dict = { + 'black': "UP", + 'white': "low" + } + with self.assertRaises(petstore_api.ApiValueError): + MapTest(map_of_enum_string=black_or_white_dict) + + def test_maptest_setter(self): + # + # Check with some valid values + # + map_enum_test = MapTest() + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_enum_test.map_of_enum_string = up_or_low_dict + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + + # + # Check if the setter fails for invalid enum values + # + map_enum_test = MapTest() + black_or_white_dict = { + 'black': "UP", + 'white': "low" + } + with self.assertRaises(petstore_api.ApiValueError): + map_enum_test.map_of_enum_string = black_or_white_dict + + def test_todict(self): + # + # Check dictionary serialization + # + map_enum_test = MapTest() + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_of_map_of_strings = { + 'valueDict': up_or_low_dict + } + indirect_map = string_boolean_map.StringBooleanMap(**{ + 'option1': True + }) + direct_map = { + 'option2': False + } + map_enum_test.map_of_enum_string = up_or_low_dict + map_enum_test.map_map_of_string = map_of_map_of_strings + map_enum_test.indirect_map = indirect_map + map_enum_test.direct_map = direct_map + + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) + self.assertEqual(map_enum_test.indirect_map, indirect_map) + self.assertEqual(map_enum_test.direct_map, direct_map) + + expected_dict = { + 'map_of_enum_string': up_or_low_dict, + 'map_map_of_string': map_of_map_of_strings, + 'indirect_map': indirect_map.to_dict(), + 'direct_map': direct_map + } + self.assertEqual(map_enum_test.to_dict(), expected_dict) if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py index 8893bdaf44ee..4dcb5ad4268c 100644 --- a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -5,18 +5,22 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): @@ -31,7 +35,7 @@ def tearDown(self): def testMixedPropertiesAndAdditionalPropertiesClass(self): """Test MixedPropertiesAndAdditionalPropertiesClass""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 + # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_model200_response.py b/samples/client/petstore/python-experimental/test/test_model200_response.py index fab761f4edba..4012eaae3362 100644 --- a/samples/client/petstore/python-experimental/test/test_model200_response.py +++ b/samples/client/petstore/python-experimental/test/test_model200_response.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.model200_response import Model200Response # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.model200_response import Model200Response class TestModel200Response(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testModel200Response(self): """Test Model200Response""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.model200_response.Model200Response() # noqa: E501 + # model = Model200Response() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_model_return.py b/samples/client/petstore/python-experimental/test/test_model_return.py index ae3f15ee6b83..54c98b33cd66 100644 --- a/samples/client/petstore/python-experimental/test/test_model_return.py +++ b/samples/client/petstore/python-experimental/test/test_model_return.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.model_return import ModelReturn # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.model_return import ModelReturn class TestModelReturn(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testModelReturn(self): """Test ModelReturn""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 + # model = ModelReturn() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_name.py b/samples/client/petstore/python-experimental/test/test_name.py index d6c72563991f..6a9be99d1a57 100644 --- a/samples/client/petstore/python-experimental/test/test_name.py +++ b/samples/client/petstore/python-experimental/test/test_name.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.name import Name # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.name import Name class TestName(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testName(self): """Test Name""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.name.Name() # noqa: E501 + # model = Name() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_number_only.py b/samples/client/petstore/python-experimental/test/test_number_only.py index 7f6df65c8058..07aab1d78af7 100644 --- a/samples/client/petstore/python-experimental/test/test_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_number_only.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.number_only import NumberOnly # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.number_only import NumberOnly class TestNumberOnly(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testNumberOnly(self): """Test NumberOnly""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 + # model = NumberOnly() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_order.py b/samples/client/petstore/python-experimental/test/test_order.py index 3e7d517d5c79..ee6988e28ccd 100644 --- a/samples/client/petstore/python-experimental/test/test_order.py +++ b/samples/client/petstore/python-experimental/test/test_order.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.order import Order # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.order import Order class TestOrder(unittest.TestCase): @@ -30,9 +29,12 @@ def tearDown(self): def testOrder(self): """Test Order""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.order.Order() # noqa: E501 - pass + order = Order() + order.status = "placed" + self.assertEqual("placed", order.status) + with self.assertRaises(petstore_api.ApiValueError): + order.status = "invalid" + if __name__ == '__main__': diff --git a/samples/client/petstore/python-experimental/test/test_outer_composite.py b/samples/client/petstore/python-experimental/test/test_outer_composite.py index dcb078cd2164..f3ad1beff9e4 100644 --- a/samples/client/petstore/python-experimental/test/test_outer_composite.py +++ b/samples/client/petstore/python-experimental/test/test_outer_composite.py @@ -5,18 +5,22 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.outer_composite import OuterComposite # noqa: E501 -from petstore_api.rest import ApiException +try: + from petstore_api.model import outer_number +except ImportError: + outer_number = sys.modules[ + 'petstore_api.model.outer_number'] +from petstore_api.model.outer_composite import OuterComposite class TestOuterComposite(unittest.TestCase): @@ -31,7 +35,7 @@ def tearDown(self): def testOuterComposite(self): """Test OuterComposite""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 + # model = OuterComposite() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_outer_enum.py b/samples/client/petstore/python-experimental/test/test_outer_enum.py index 50bfff0869b7..ff84ad3ba6d4 100644 --- a/samples/client/petstore/python-experimental/test/test_outer_enum.py +++ b/samples/client/petstore/python-experimental/test/test_outer_enum.py @@ -11,12 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.outer_enum import OuterEnum # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.outer_enum import OuterEnum class TestOuterEnum(unittest.TestCase): @@ -43,5 +42,6 @@ def testOuterEnum(self): valid_value = OuterEnum.allowed_values[('value',)]['PLACED'] assert valid_value == OuterEnum(valid_value).value + if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_outer_number.py b/samples/client/petstore/python-experimental/test/test_outer_number.py index 31c9c41755dc..e0ab10d91d61 100644 --- a/samples/client/petstore/python-experimental/test/test_outer_number.py +++ b/samples/client/petstore/python-experimental/test/test_outer_number.py @@ -11,12 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.outer_number import OuterNumber # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.outer_number import OuterNumber class TestOuterNumber(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testOuterNumber(self): """Test OuterNumber""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_number.OuterNumber() # noqa: E501 + # model = OuterNumber() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_parent.py b/samples/client/petstore/python-experimental/test/test_parent.py index f719771bdcfb..20282dfb41ea 100644 --- a/samples/client/petstore/python-experimental/test/test_parent.py +++ b/samples/client/petstore/python-experimental/test/test_parent.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import grandparent +except ImportError: + grandparent = sys.modules[ + 'petstore_api.model.grandparent'] +try: + from petstore_api.model import parent_all_of +except ImportError: + parent_all_of = sys.modules[ + 'petstore_api.model.parent_all_of'] +from petstore_api.model.parent import Parent class TestParent(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testParent(self): """Test Parent""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Parent() # noqa: E501 + # model = Parent() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_parent_all_of.py b/samples/client/petstore/python-experimental/test/test_parent_all_of.py index c1c152afe18a..ca87189bba50 100644 --- a/samples/client/petstore/python-experimental/test/test_parent_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_parent_all_of.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.parent_all_of import ParentAllOf class TestParentAllOf(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testParentAllOf(self): """Test ParentAllOf""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ParentAllOf() # noqa: E501 + # model = ParentAllOf() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_parent_pet.py b/samples/client/petstore/python-experimental/test/test_parent_pet.py index b3ec1a94532c..17a4d60e75dc 100644 --- a/samples/client/petstore/python-experimental/test/test_parent_pet.py +++ b/samples/client/petstore/python-experimental/test/test_parent_pet.py @@ -11,10 +11,31 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import child_cat +except ImportError: + child_cat = sys.modules[ + 'petstore_api.model.child_cat'] +try: + from petstore_api.model import child_dog +except ImportError: + child_dog = sys.modules[ + 'petstore_api.model.child_dog'] +try: + from petstore_api.model import child_lizard +except ImportError: + child_lizard = sys.modules[ + 'petstore_api.model.child_lizard'] +try: + from petstore_api.model import grandparent_animal +except ImportError: + grandparent_animal = sys.modules[ + 'petstore_api.model.grandparent_animal'] +from petstore_api.model.parent_pet import ParentPet class TestParentPet(unittest.TestCase): @@ -29,7 +50,7 @@ def tearDown(self): def testParentPet(self): """Test ParentPet""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ParentPet() # noqa: E501 + # model = ParentPet() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_pet.py b/samples/client/petstore/python-experimental/test/test_pet.py index bc5cc30fac0d..b072cff5e9ad 100644 --- a/samples/client/petstore/python-experimental/test/test_pet.py +++ b/samples/client/petstore/python-experimental/test/test_pet.py @@ -5,18 +5,27 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.pet import Pet # noqa: E501 -from petstore_api.rest import ApiException +try: + from petstore_api.model import category +except ImportError: + category = sys.modules[ + 'petstore_api.model.category'] +try: + from petstore_api.models import tag +except ImportError: + tag = sys.modules[ + 'petstore_api.model.tag'] +from petstore_api.model.pet import Pet class TestPet(unittest.TestCase): @@ -28,11 +37,52 @@ def setUp(self): def tearDown(self): pass - def testPet(self): - """Test Pet""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.pet.Pet() # noqa: E501 - pass + def test_to_str(self): + pet = Pet(name="test name", photo_urls=["string"]) + pet.id = 1 + pet.status = "available" + cate = category.Category() + cate.id = 1 + cate.name = "dog" + pet.category = cate + tag1 = tag.Tag() + tag1.id = 1 + pet.tags = [tag1] + + data = ("{'category': {'id': 1, 'name': 'dog'},\n" + " 'id': 1,\n" + " 'name': 'test name',\n" + " 'photo_urls': ['string'],\n" + " 'status': 'available',\n" + " 'tags': [{'id': 1}]}") + self.assertEqual(data, pet.to_str()) + + def test_equal(self): + pet1 = Pet(name="test name", photo_urls=["string"]) + pet1.id = 1 + pet1.status = "available" + cate1 = category.Category() + cate1.id = 1 + cate1.name = "dog" + tag1 = tag.Tag() + tag1.id = 1 + pet1.tags = [tag1] + + pet2 = Pet(name="test name", photo_urls=["string"]) + pet2.id = 1 + pet2.status = "available" + cate2 = category.Category() + cate2.id = 1 + cate2.name = "dog" + tag2 = tag.Tag() + tag2.id = 1 + pet2.tags = [tag2] + + self.assertTrue(pet1 == pet2) + + # reset pet1 tags to empty array so that object comparison returns false + pet1.tags = [] + self.assertFalse(pet1 == pet2) if __name__ == '__main__': diff --git a/samples/client/petstore/python-experimental/test/test_pet_api.py b/samples/client/petstore/python-experimental/test/test_pet_api.py index ffd3e25c4c64..091b30cf8ac0 100644 --- a/samples/client/petstore/python-experimental/test/test_pet_api.py +++ b/samples/client/petstore/python-experimental/test/test_pet_api.py @@ -5,25 +5,24 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api from petstore_api.api.pet_api import PetApi # noqa: E501 -from petstore_api.rest import ApiException class TestPetApi(unittest.TestCase): """PetApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 + self.api = PetApi() # noqa: E501 def tearDown(self): pass @@ -84,6 +83,13 @@ def test_upload_file(self): """ pass + def test_upload_file_with_required_file(self): + """Test case for upload_file_with_required_file + + uploads an image (required) # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_player.py b/samples/client/petstore/python-experimental/test/test_player.py index b100dd798943..ee7b95a677f1 100644 --- a/samples/client/petstore/python-experimental/test/test_player.py +++ b/samples/client/petstore/python-experimental/test/test_player.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.player import Player class TestPlayer(unittest.TestCase): @@ -29,13 +30,13 @@ def tearDown(self): def testPlayer(self): """Test Player""" # we can make a player without an enemy_player property - jane = petstore_api.Player(name="Jane") + jane = Player(name="Jane") # we can make a player with an enemy_player - sally = petstore_api.Player(name="Sally", enemy_player=jane) + sally = Player(name="Sally", enemy_player=jane) # we can make a player with an inline enemy_player - jim = petstore_api.Player( + jim = Player( name="Jim", - enemy_player=petstore_api.Player(name="Sam") + enemy_player=Player(name="Sam") ) diff --git a/samples/client/petstore/python-experimental/test/test_read_only_first.py b/samples/client/petstore/python-experimental/test/test_read_only_first.py index 2b647b83fc89..c2dcde240e77 100644 --- a/samples/client/petstore/python-experimental/test/test_read_only_first.py +++ b/samples/client/petstore/python-experimental/test/test_read_only_first.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.read_only_first import ReadOnlyFirst class TestReadOnlyFirst(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testReadOnlyFirst(self): """Test ReadOnlyFirst""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 + # model = ReadOnlyFirst() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_special_model_name.py b/samples/client/petstore/python-experimental/test/test_special_model_name.py index 4edfec164f7d..6124525f5170 100644 --- a/samples/client/petstore/python-experimental/test/test_special_model_name.py +++ b/samples/client/petstore/python-experimental/test/test_special_model_name.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.special_model_name import SpecialModelName class TestSpecialModelName(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testSpecialModelName(self): """Test SpecialModelName""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 + # model = SpecialModelName() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_store_api.py b/samples/client/petstore/python-experimental/test/test_store_api.py index 37bf771d13a6..0d9cc3dd36ea 100644 --- a/samples/client/petstore/python-experimental/test/test_store_api.py +++ b/samples/client/petstore/python-experimental/test/test_store_api.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -16,14 +16,13 @@ import petstore_api from petstore_api.api.store_api import StoreApi # noqa: E501 -from petstore_api.rest import ApiException class TestStoreApi(unittest.TestCase): """StoreApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 + self.api = StoreApi() # noqa: E501 def tearDown(self): pass diff --git a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py index 31c1ebeec5db..e2e9d8b420b8 100644 --- a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py +++ b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -11,12 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.string_boolean_map import StringBooleanMap # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.string_boolean_map import StringBooleanMap class TestStringBooleanMap(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testStringBooleanMap(self): """Test StringBooleanMap""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.string_boolean_map.StringBooleanMap() # noqa: E501 + # model = StringBooleanMap() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_tag.py b/samples/client/petstore/python-experimental/test/test_tag.py index 2c3c5157e718..68a3b9046bf4 100644 --- a/samples/client/petstore/python-experimental/test/test_tag.py +++ b/samples/client/petstore/python-experimental/test/test_tag.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.tag import Tag # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.tag import Tag class TestTag(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testTag(self): """Test Tag""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.tag.Tag() # noqa: E501 + # model = Tag() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_default.py b/samples/client/petstore/python-experimental/test/test_type_holder_default.py index 08a201b854d0..f9c050b81a82 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_default.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_default.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.type_holder_default import TypeHolderDefault # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.type_holder_default import TypeHolderDefault class TestTypeHolderDefault(unittest.TestCase): diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_example.py b/samples/client/petstore/python-experimental/test/test_type_holder_example.py index 7a2621494857..e1ee7c368628 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_example.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_example.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.type_holder_example import TypeHolderExample # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.type_holder_example import TypeHolderExample class TestTypeHolderExample(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testTypeHolderExample(self): """Test TypeHolderExample""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.type_holder_example.TypeHolderExample() # noqa: E501 + # model = TypeHolderExample() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_user.py b/samples/client/petstore/python-experimental/test/test_user.py index ad9386b6908e..7241bb589c52 100644 --- a/samples/client/petstore/python-experimental/test/test_user.py +++ b/samples/client/petstore/python-experimental/test/test_user.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.user import User # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.user import User class TestUser(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testUser(self): """Test User""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.user.User() # noqa: E501 + # model = User() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_user_api.py b/samples/client/petstore/python-experimental/test/test_user_api.py index 6e8aed4f18c7..df306da07761 100644 --- a/samples/client/petstore/python-experimental/test/test_user_api.py +++ b/samples/client/petstore/python-experimental/test/test_user_api.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -16,14 +16,13 @@ import petstore_api from petstore_api.api.user_api import UserApi # noqa: E501 -from petstore_api.rest import ApiException class TestUserApi(unittest.TestCase): """UserApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.user_api.UserApi() # noqa: E501 + self.api = UserApi() # noqa: E501 def tearDown(self): pass diff --git a/samples/client/petstore/python-experimental/test/test_xml_item.py b/samples/client/petstore/python-experimental/test/test_xml_item.py index 121f1ccb6623..4354664815ff 100644 --- a/samples/client/petstore/python-experimental/test/test_xml_item.py +++ b/samples/client/petstore/python-experimental/test/test_xml_item.py @@ -5,18 +5,17 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import - +import sys import unittest import petstore_api -from petstore_api.models.xml_item import XmlItem # noqa: E501 -from petstore_api.rest import ApiException +from petstore_api.model.xml_item import XmlItem class TestXmlItem(unittest.TestCase): @@ -31,7 +30,7 @@ def tearDown(self): def testXmlItem(self): """Test XmlItem""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.xml_item.XmlItem() # noqa: E501 + # model = XmlItem() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/tests/test_api_client.py b/samples/client/petstore/python-experimental/tests/test_api_client.py index f36762e84e8e..c249bf1fc5e8 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_client.py +++ b/samples/client/petstore/python-experimental/tests/test_api_client.py @@ -171,16 +171,20 @@ def test_sanitize_for_serialization(self): "status": "available", "photoUrls": ["http://foo.bar.com/3", "http://foo.bar.com/4"]} - pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) + from petstore_api.model.pet import Pet + from petstore_api.model.category import Category + from petstore_api.model.tag import Tag + from petstore_api.model.string_boolean_map import StringBooleanMap + pet = Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) pet.id = pet_dict["id"] - cate = petstore_api.Category() + cate = Category() cate.id = pet_dict["category"]["id"] cate.name = pet_dict["category"]["name"] pet.category = cate - tag1 = petstore_api.Tag() + tag1 = Tag() tag1.id = pet_dict["tags"][0]["id"] tag1.full_name = pet_dict["tags"][0]["fullName"] - tag2 = petstore_api.Tag() + tag2 = Tag() tag2.id = pet_dict["tags"][1]["id"] tag2.full_name = pet_dict["tags"][1]["fullName"] pet.tags = [tag1, tag2] @@ -198,7 +202,7 @@ def test_sanitize_for_serialization(self): # model with additional proerties model_dict = {'some_key': True} - model = petstore_api.StringBooleanMap(**model_dict) + model = StringBooleanMap(**model_dict) result = self.api_client.sanitize_for_serialization(model) self.assertEqual(result, model_dict) diff --git a/samples/client/petstore/python-experimental/tests/test_api_exception.py b/samples/client/petstore/python-experimental/tests/test_api_exception.py index b26ef5252bbf..0d0771b57850 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_exception.py +++ b/samples/client/petstore/python-experimental/tests/test_api_exception.py @@ -15,7 +15,6 @@ import unittest import petstore_api -from petstore_api.rest import ApiException from .util import id_gen @@ -23,17 +22,19 @@ class ApiExceptionTests(unittest.TestCase): def setUp(self): self.api_client = petstore_api.ApiClient() - self.pet_api = petstore_api.PetApi(self.api_client) + from petstore_api.api.pet_api import PetApi + self.pet_api = PetApi(self.api_client) self.setUpModels() def setUpModels(self): - self.category = petstore_api.Category() + from petstore_api.model import category, tag, pet + self.category = category.Category() self.category.id = id_gen() self.category.name = "dog" - self.tag = petstore_api.Tag() + self.tag = tag.Tag() self.tag.id = id_gen() self.tag.full_name = "blank" - self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) self.pet.id = id_gen() self.pet.status = "sold" self.pet.category = self.category @@ -43,12 +44,12 @@ def test_404_error(self): self.pet_api.add_pet(self.pet) self.pet_api.delete_pet(pet_id=self.pet.id) - with self.checkRaiseRegex(ApiException, "Pet not found"): + with self.checkRaiseRegex(petstore_api.ApiException, "Pet not found"): self.pet_api.get_pet_by_id(pet_id=self.pet.id) try: self.pet_api.get_pet_by_id(pet_id=self.pet.id) - except ApiException as e: + except petstore_api.ApiException as e: self.assertEqual(e.status, 404) self.assertEqual(e.reason, "Not Found") self.checkRegex(e.body, "Pet not found") @@ -56,7 +57,7 @@ def test_404_error(self): def test_500_error(self): self.pet_api.add_pet(self.pet) - with self.checkRaiseRegex(ApiException, "Internal Server Error"): + with self.checkRaiseRegex(petstore_api.ApiException, "Internal Server Error"): self.pet_api.upload_file( pet_id=self.pet.id, additional_metadata="special" @@ -67,7 +68,7 @@ def test_500_error(self): pet_id=self.pet.id, additional_metadata="special" ) - except ApiException as e: + except petstore_api.ApiException as e: self.assertEqual(e.status, 500) self.assertEqual(e.reason, "Internal Server Error") self.checkRegex(e.body, "Error 500 Internal Server Error") diff --git a/samples/client/petstore/python-experimental/tests/test_deserialization.py b/samples/client/petstore/python-experimental/tests/test_deserialization.py index 83ecabe81d25..f73af24a9425 100644 --- a/samples/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/client/petstore/python-experimental/tests/test_deserialization.py @@ -24,7 +24,18 @@ ApiKeyError, ApiValueError, ) - +from petstore_api.model import ( + enum_test, + pet, + animal, + dog, + parent_pet, + child_lizard, + category, + outer_enum, + outer_number, + string_boolean_map, +) from petstore_api.model_utils import ( file_type, int, @@ -56,19 +67,19 @@ def test_enum_test(self): response = MockResponse(data=json.dumps(data)) deserialized = self.deserialize(response, - ({str: (petstore_api.EnumTest,)},), True) + ({str: (enum_test.EnumTest,)},), True) self.assertTrue(isinstance(deserialized, dict)) self.assertTrue( - isinstance(deserialized['enum_test'], petstore_api.EnumTest)) - outer_enum_value = ( - petstore_api.OuterEnum.allowed_values[('value',)]["PLACED"]) - outer_enum = petstore_api.OuterEnum(outer_enum_value) - sample_instance = petstore_api.EnumTest( + isinstance(deserialized['enum_test'], enum_test.EnumTest)) + value = ( + outer_enum.OuterEnum.allowed_values[('value',)]["PLACED"]) + outer_enum_val = outer_enum.OuterEnum(value) + sample_instance = enum_test.EnumTest( enum_string="UPPER", enum_string_required="lower", enum_integer=1, enum_number=1.1, - outer_enum=outer_enum + outer_enum=outer_enum_val ) self.assertEqual(deserialized['enum_test'], sample_instance) @@ -97,9 +108,9 @@ def test_deserialize_dict_str_pet(self): response = MockResponse(data=json.dumps(data)) deserialized = self.deserialize(response, - ({str: (petstore_api.Pet,)},), True) + ({str: (pet.Pet,)},), True) self.assertTrue(isinstance(deserialized, dict)) - self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet)) + self.assertTrue(isinstance(deserialized['pet'], pet.Pet)) def test_deserialize_dict_str_dog(self): """ deserialize dict(str, Dog), use discriminator""" @@ -113,13 +124,13 @@ def test_deserialize_dict_str_dog(self): response = MockResponse(data=json.dumps(data)) deserialized = self.deserialize(response, - ({str: (petstore_api.Animal,)},), True) + ({str: (animal.Animal,)},), True) self.assertTrue(isinstance(deserialized, dict)) - dog = deserialized['dog'] - self.assertTrue(isinstance(dog, petstore_api.Dog)) - self.assertEqual(dog.class_name, "Dog") - self.assertEqual(dog.color, "white") - self.assertEqual(dog.breed, "Jack Russel Terrier") + dog_inst = deserialized['dog'] + self.assertTrue(isinstance(dog_inst, dog.Dog)) + self.assertEqual(dog_inst.class_name, "Dog") + self.assertEqual(dog_inst.color, "white") + self.assertEqual(dog_inst.breed, "Jack Russel Terrier") def test_deserialize_lizard(self): """ deserialize ChildLizard, use discriminator""" @@ -130,8 +141,8 @@ def test_deserialize_lizard(self): response = MockResponse(data=json.dumps(data)) lizard = self.deserialize(response, - (petstore_api.ParentPet,), True) - self.assertTrue(isinstance(lizard, petstore_api.ChildLizard)) + (parent_pet.ParentPet,), True) + self.assertTrue(isinstance(lizard, child_lizard.ChildLizard)) self.assertEqual(lizard.pet_type, "ChildLizard") self.assertEqual(lizard.loves_rocks, True) @@ -192,11 +203,11 @@ def test_deserialize_pet(self): } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.Pet,), True) - self.assertTrue(isinstance(deserialized, petstore_api.Pet)) + deserialized = self.deserialize(response, (pet.Pet,), True) + self.assertTrue(isinstance(deserialized, pet.Pet)) self.assertEqual(deserialized.id, 0) self.assertEqual(deserialized.name, "doggie") - self.assertTrue(isinstance(deserialized.category, petstore_api.Category)) + self.assertTrue(isinstance(deserialized.category, category.Category)) self.assertEqual(deserialized.category.name, "string") self.assertTrue(isinstance(deserialized.tags, list)) self.assertEqual(deserialized.tags[0].full_name, "string") @@ -243,9 +254,9 @@ def test_deserialize_list_of_pet(self): response = MockResponse(data=json.dumps(data)) deserialized = self.deserialize(response, - ([petstore_api.Pet],), True) + ([pet.Pet],), True) self.assertTrue(isinstance(deserialized, list)) - self.assertTrue(isinstance(deserialized[0], petstore_api.Pet)) + self.assertTrue(isinstance(deserialized[0], pet.Pet)) self.assertEqual(deserialized[0].id, 0) self.assertEqual(deserialized[1].id, 1) self.assertEqual(deserialized[0].name, "doggie0") @@ -294,19 +305,19 @@ def test_deserialize_OuterEnum(self): with self.assertRaises(ApiValueError): self.deserialize( MockResponse(data=json.dumps("test str")), - (petstore_api.OuterEnum,), + (outer_enum.OuterEnum,), True ) # valid value works placed_str = ( - petstore_api.OuterEnum.allowed_values[('value',)]["PLACED"] + outer_enum.OuterEnum.allowed_values[('value',)]["PLACED"] ) response = MockResponse(data=json.dumps(placed_str)) - outer_enum = self.deserialize(response, - (petstore_api.OuterEnum,), True) - self.assertTrue(isinstance(outer_enum, petstore_api.OuterEnum)) - self.assertTrue(outer_enum.value == placed_str) + deserialized = self.deserialize(response, + (outer_enum.OuterEnum,), True) + self.assertTrue(isinstance(deserialized, outer_enum.OuterEnum)) + self.assertTrue(deserialized.value == placed_str) def test_deserialize_OuterNumber(self): """ deserialize OuterNumber """ @@ -314,7 +325,7 @@ def test_deserialize_OuterNumber(self): with self.assertRaises(ApiTypeError): deserialized = self.deserialize( MockResponse(data=json.dumps("test str")), - (petstore_api.OuterNumber,), + (outer_number.OuterNumber,), True ) @@ -322,17 +333,17 @@ def test_deserialize_OuterNumber(self): with self.assertRaises(ApiValueError): deserialized = self.deserialize( MockResponse(data=json.dumps(21.0)), - (petstore_api.OuterNumber,), + (outer_number.OuterNumber,), True ) # valid value works number_val = 11.0 response = MockResponse(data=json.dumps(number_val)) - outer_number = self.deserialize(response, - (petstore_api.OuterNumber,), True) - self.assertTrue(isinstance(outer_number, petstore_api.OuterNumber)) - self.assertTrue(outer_number.value == number_val) + number = self.deserialize(response, + (outer_number.OuterNumber,), True) + self.assertTrue(isinstance(number, outer_number.OuterNumber)) + self.assertTrue(number.value == number_val) def test_deserialize_file(self): """Ensures that file deserialization works""" @@ -416,17 +427,17 @@ def test_deserialize_string_boolean_map(self): with self.assertRaises(ApiTypeError): deserialized = self.deserialize( MockResponse(data=json.dumps("test str")), - (petstore_api.StringBooleanMap,), + (string_boolean_map.StringBooleanMap,), True ) # valid value works item_val = {'some_key': True} response = MockResponse(data=json.dumps(item_val)) - model = petstore_api.StringBooleanMap(**item_val) + model = string_boolean_map.StringBooleanMap(**item_val) deserialized = self.deserialize(response, - (petstore_api.StringBooleanMap,), True) - self.assertTrue(isinstance(deserialized, petstore_api.StringBooleanMap)) + (string_boolean_map.StringBooleanMap,), True) + self.assertTrue(isinstance(deserialized, string_boolean_map.StringBooleanMap)) self.assertTrue(deserialized['some_key'] == True) self.assertTrue(deserialized == model) diff --git a/samples/client/petstore/python-experimental/tests/test_enum_arrays.py b/samples/client/petstore/python-experimental/tests/test_enum_arrays.py deleted file mode 100644 index 96edf49c43a9..000000000000 --- a/samples/client/petstore/python-experimental/tests/test_enum_arrays.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api - -from petstore_api.exceptions import ( - ApiTypeError, - ApiKeyError, - ApiValueError, -) - -class EnumArraysTests(unittest.TestCase): - - def test_enumarrays_init(self): - # - # Check various combinations of valid values. - # - fish_or_crab = petstore_api.EnumArrays(just_symbol=">=") - self.assertEqual(fish_or_crab.just_symbol, ">=") - # if optional property is unset we raise an exception - with self.assertRaises(AttributeError) as exc: - self.assertEqual(fish_or_crab.array_enum, None) - - fish_or_crab = petstore_api.EnumArrays(just_symbol="$", array_enum=["fish"]) - self.assertEqual(fish_or_crab.just_symbol, "$") - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab = petstore_api.EnumArrays(just_symbol=">=", array_enum=["fish"]) - self.assertEqual(fish_or_crab.just_symbol, ">=") - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab = petstore_api.EnumArrays(just_symbol="$", array_enum=["crab"]) - self.assertEqual(fish_or_crab.just_symbol, "$") - self.assertEqual(fish_or_crab.array_enum, ["crab"]) - - - # - # Check if setting invalid values fails - # - with self.assertRaises(ApiValueError) as exc: - fish_or_crab = petstore_api.EnumArrays(just_symbol="<=") - - with self.assertRaises(ApiValueError) as exc: - fish_or_crab = petstore_api.EnumArrays(just_symbol="$", array_enum=["dog"]) - - with self.assertRaises(ApiTypeError) as exc: - fish_or_crab = petstore_api.EnumArrays(just_symbol=["$"], array_enum=["crab"]) - - - def test_enumarrays_setter(self): - - # - # Check various combinations of valid values - # - fish_or_crab = petstore_api.EnumArrays() - - fish_or_crab.just_symbol = ">=" - self.assertEqual(fish_or_crab.just_symbol, ">=") - - fish_or_crab.just_symbol = "$" - self.assertEqual(fish_or_crab.just_symbol, "$") - - fish_or_crab.array_enum = [] - self.assertEqual(fish_or_crab.array_enum, []) - - fish_or_crab.array_enum = ["fish"] - self.assertEqual(fish_or_crab.array_enum, ["fish"]) - - fish_or_crab.array_enum = ["fish", "fish", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["fish", "fish", "fish"]) - - fish_or_crab.array_enum = ["crab"] - self.assertEqual(fish_or_crab.array_enum, ["crab"]) - - fish_or_crab.array_enum = ["crab", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["crab", "fish"]) - - fish_or_crab.array_enum = ["crab", "fish", "crab", "fish"] - self.assertEqual(fish_or_crab.array_enum, ["crab", "fish", "crab", "fish"]) - - # - # Check if setting invalid values fails - # - fish_or_crab = petstore_api.EnumArrays() - with self.assertRaises(ApiValueError) as exc: - fish_or_crab.just_symbol = "!=" - - with self.assertRaises(ApiTypeError) as exc: - fish_or_crab.just_symbol = ["fish"] - - with self.assertRaises(ApiValueError) as exc: - fish_or_crab.array_enum = ["cat"] - - with self.assertRaises(ApiValueError) as exc: - fish_or_crab.array_enum = ["fish", "crab", "dog"] - - with self.assertRaises(ApiTypeError) as exc: - fish_or_crab.array_enum = "fish" - - - def test_todict(self): - # - # Check if dictionary serialization works - # - dollar_fish_crab_dict = { - 'just_symbol': "$", - 'array_enum': ["fish", "crab"] - } - - dollar_fish_crab = petstore_api.EnumArrays( - just_symbol="$", array_enum=["fish", "crab"]) - - self.assertEqual(dollar_fish_crab_dict, dollar_fish_crab.to_dict()) - - # - # Sanity check for different arrays - # - dollar_crab_fish_dict = { - 'just_symbol': "$", - 'array_enum': ["crab", "fish"] - } - - dollar_fish_crab = petstore_api.EnumArrays( - just_symbol="$", array_enum=["fish", "crab"]) - - self.assertNotEqual(dollar_crab_fish_dict, dollar_fish_crab.to_dict()) - - - def test_equals(self): - # - # Check if object comparison works - # - fish1 = petstore_api.EnumArrays(just_symbol="$", array_enum=["fish"]) - fish2 = petstore_api.EnumArrays(just_symbol="$", array_enum=["fish"]) - self.assertEqual(fish1, fish2) - - fish = petstore_api.EnumArrays(just_symbol="$", array_enum=["fish"]) - crab = petstore_api.EnumArrays(just_symbol="$", array_enum=["crab"]) - self.assertNotEqual(fish, crab) - - dollar = petstore_api.EnumArrays(just_symbol="$") - greater = petstore_api.EnumArrays(just_symbol=">=") - self.assertNotEqual(dollar, greater) diff --git a/samples/client/petstore/python-experimental/tests/test_map_test.py b/samples/client/petstore/python-experimental/tests/test_map_test.py deleted file mode 100644 index 13db5181c9ed..000000000000 --- a/samples/client/petstore/python-experimental/tests/test_map_test.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api - -from petstore_api.exceptions import ( - ApiTypeError, - ApiKeyError, - ApiValueError, -) - - -class MapTestTests(unittest.TestCase): - - def test_maptest_init(self): - # - # Test MapTest construction with valid values - # - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_enum_test = petstore_api.MapTest(map_of_enum_string=up_or_low_dict) - - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - - map_of_map_of_strings = { - 'valueDict': up_or_low_dict - } - map_enum_test = petstore_api.MapTest(map_map_of_string=map_of_map_of_strings) - - self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) - - # - # Make sure that the init fails for invalid enum values - # - black_or_white_dict = { - 'black': "UP", - 'white': "low" - } - try: - map_enum_test = petstore_api.MapTest(map_of_enum_string=black_or_white_dict) - self.assertTrue(0) - except ValueError: - self.assertTrue(1) - - def test_maptest_setter(self): - # - # Check with some valid values - # - map_enum_test = petstore_api.MapTest() - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_enum_test.map_of_enum_string = up_or_low_dict - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - - # - # Check if the setter fails for invalid enum values - # - map_enum_test = petstore_api.MapTest() - black_or_white_dict = { - 'black': "UP", - 'white': "low" - } - with self.assertRaises(ApiValueError) as exc: - map_enum_test.map_of_enum_string = black_or_white_dict - - def test_todict(self): - # - # Check dictionary serialization - # - map_enum_test = petstore_api.MapTest() - up_or_low_dict = { - 'UPPER': "UP", - 'lower': "low" - } - map_of_map_of_strings = { - 'valueDict': up_or_low_dict - } - indirect_map = petstore_api.StringBooleanMap(**{ - 'option1': True - }) - direct_map = { - 'option2': False - } - map_enum_test.map_of_enum_string = up_or_low_dict - map_enum_test.map_map_of_string = map_of_map_of_strings - map_enum_test.indirect_map = indirect_map - map_enum_test.direct_map = direct_map - - self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) - self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) - self.assertEqual(map_enum_test.indirect_map, indirect_map) - self.assertEqual(map_enum_test.direct_map, direct_map) - - expected_dict = { - 'map_of_enum_string': up_or_low_dict, - 'map_map_of_string': map_of_map_of_strings, - 'indirect_map': indirect_map.to_dict(), - 'direct_map': direct_map - } - - self.assertEqual(map_enum_test.to_dict(), expected_dict) diff --git a/samples/client/petstore/python-experimental/tests/test_order_model.py b/samples/client/petstore/python-experimental/tests/test_order_model.py deleted file mode 100644 index 31dc6e3661cd..000000000000 --- a/samples/client/petstore/python-experimental/tests/test_order_model.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api - - -class OrderModelTests(unittest.TestCase): - - def test_status(self): - order = petstore_api.Order() - order.status = "placed" - self.assertEqual("placed", order.status) - - with self.assertRaises(ValueError): - order.status = "invalid" diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index ee7e53ecad85..38d7a1cc0b82 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -30,7 +30,8 @@ ApiValueError, ApiTypeError, ) - +from petstore_api.api.pet_api import PetApi +from petstore_api.model import pet from .util import id_gen import urllib3 @@ -75,18 +76,19 @@ def setUp(self): config.host = HOST config.access_token = 'ACCESS_TOKEN' self.api_client = petstore_api.ApiClient(config) - self.pet_api = petstore_api.PetApi(self.api_client) + self.pet_api = PetApi(self.api_client) self.setUpModels() self.setUpFiles() def setUpModels(self): - self.category = petstore_api.Category() + from petstore_api.model import category, tag + self.category = category.Category() self.category.id = id_gen() self.category.name = "dog" - self.tag = petstore_api.Tag() + self.tag = tag.Tag() self.tag.id = id_gen() self.tag.name = "python-pet-tag" - self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet = pet.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) self.pet.id = id_gen() self.pet.status = "sold" self.pet.category = self.category @@ -162,8 +164,8 @@ def test_timeout(self): self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) def test_separate_default_client_instances(self): - pet_api = petstore_api.PetApi() - pet_api2 = petstore_api.PetApi() + pet_api = PetApi() + pet_api2 = PetApi() self.assertNotEqual(pet_api.api_client, pet_api2.api_client) pet_api.api_client.user_agent = 'api client 3' @@ -172,8 +174,8 @@ def test_separate_default_client_instances(self): self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) def test_separate_default_config_instances(self): - pet_api = petstore_api.PetApi() - pet_api2 = petstore_api.PetApi() + pet_api = PetApi() + pet_api2 = PetApi() self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) pet_api.api_client.configuration.host = 'somehost' @@ -187,7 +189,7 @@ def test_async_request(self): thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) result = thread.get() - self.assertIsInstance(result, petstore_api.Pet) + self.assertIsInstance(result, pet.Pet) def test_async_with_result(self): self.pet_api.add_pet(self.pet, async_req=False) @@ -208,7 +210,7 @@ def test_async_with_http_info(self): _return_http_data_only=False) data, status, headers = thread.get() - self.assertIsInstance(data, petstore_api.Pet) + self.assertIsInstance(data, pet.Pet) self.assertEqual(status, 200) def test_async_exception(self): diff --git a/samples/client/petstore/python-experimental/tests/test_pet_model.py b/samples/client/petstore/python-experimental/tests/test_pet_model.py deleted file mode 100644 index c3352015b973..000000000000 --- a/samples/client/petstore/python-experimental/tests/test_pet_model.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd petstore_api-python -$ nosetests -v -""" - -import os -import time -import unittest - -import petstore_api - - -class PetModelTests(unittest.TestCase): - - def setUp(self): - self.pet = petstore_api.Pet(name="test name", photo_urls=["string"]) - self.pet.id = 1 - self.pet.status = "available" - cate = petstore_api.Category() - cate.id = 1 - cate.name = "dog" - self.pet.category = cate - tag = petstore_api.Tag() - tag.id = 1 - self.pet.tags = [tag] - - def test_to_str(self): - data = ("{'category': {'id': 1, 'name': 'dog'},\n" - " 'id': 1,\n" - " 'name': 'test name',\n" - " 'photo_urls': ['string'],\n" - " 'status': 'available',\n" - " 'tags': [{'id': 1}]}") - self.assertEqual(data, self.pet.to_str()) - - def test_equal(self): - self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"]) - self.pet1.id = 1 - self.pet1.status = "available" - cate1 = petstore_api.Category() - cate1.id = 1 - cate1.name = "dog" - self.pet.category = cate1 - tag1 = petstore_api.Tag() - tag1.id = 1 - self.pet1.tags = [tag1] - - self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"]) - self.pet2.id = 1 - self.pet2.status = "available" - cate2 = petstore_api.Category() - cate2.id = 1 - cate2.name = "dog" - self.pet.category = cate2 - tag2 = petstore_api.Tag() - tag2.id = 1 - self.pet2.tags = [tag2] - - self.assertTrue(self.pet1 == self.pet2) - - # reset pet1 tags to empty array so that object comparison returns false - self.pet1.tags = [] - self.assertFalse(self.pet1 == self.pet2) diff --git a/samples/client/petstore/python-experimental/tests/test_store_api.py b/samples/client/petstore/python-experimental/tests/test_store_api.py index 1817477aba69..a7c1d5dd6670 100644 --- a/samples/client/petstore/python-experimental/tests/test_store_api.py +++ b/samples/client/petstore/python-experimental/tests/test_store_api.py @@ -14,13 +14,13 @@ import unittest import petstore_api -from petstore_api.rest import ApiException +from petstore_api.api.store_api import StoreApi class StoreApiTests(unittest.TestCase): def setUp(self): - self.store_api = petstore_api.StoreApi() + self.store_api = StoreApi() def tearDown(self): # sleep 1 sec between two every 2 tests diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES index 378e6965acc8..ffc326a12f08 100644 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -102,92 +102,94 @@ petstore_api/api/pet_api.py petstore_api/api/store_api.py petstore_api/api/user_api.py petstore_api/api_client.py +petstore_api/apis/__init__.py petstore_api/configuration.py petstore_api/exceptions.py +petstore_api/model/__init__.py +petstore_api/model/additional_properties_class.py +petstore_api/model/address.py +petstore_api/model/animal.py +petstore_api/model/api_response.py +petstore_api/model/apple.py +petstore_api/model/apple_req.py +petstore_api/model/array_of_array_of_number_only.py +petstore_api/model/array_of_number_only.py +petstore_api/model/array_test.py +petstore_api/model/banana.py +petstore_api/model/banana_req.py +petstore_api/model/basque_pig.py +petstore_api/model/capitalization.py +petstore_api/model/cat.py +petstore_api/model/cat_all_of.py +petstore_api/model/category.py +petstore_api/model/child_cat.py +petstore_api/model/child_cat_all_of.py +petstore_api/model/class_model.py +petstore_api/model/client.py +petstore_api/model/complex_quadrilateral.py +petstore_api/model/danish_pig.py +petstore_api/model/dog.py +petstore_api/model/dog_all_of.py +petstore_api/model/drawing.py +petstore_api/model/enum_arrays.py +petstore_api/model/enum_class.py +petstore_api/model/enum_test.py +petstore_api/model/equilateral_triangle.py +petstore_api/model/file.py +petstore_api/model/file_schema_test_class.py +petstore_api/model/foo.py +petstore_api/model/format_test.py +petstore_api/model/fruit.py +petstore_api/model/fruit_req.py +petstore_api/model/gm_fruit.py +petstore_api/model/grandparent_animal.py +petstore_api/model/has_only_read_only.py +petstore_api/model/health_check_result.py +petstore_api/model/inline_object.py +petstore_api/model/inline_object1.py +petstore_api/model/inline_object2.py +petstore_api/model/inline_object3.py +petstore_api/model/inline_object4.py +petstore_api/model/inline_object5.py +petstore_api/model/inline_response_default.py +petstore_api/model/isosceles_triangle.py +petstore_api/model/list.py +petstore_api/model/mammal.py +petstore_api/model/map_test.py +petstore_api/model/mixed_properties_and_additional_properties_class.py +petstore_api/model/model200_response.py +petstore_api/model/model_return.py +petstore_api/model/name.py +petstore_api/model/nullable_class.py +petstore_api/model/nullable_shape.py +petstore_api/model/number_only.py +petstore_api/model/order.py +petstore_api/model/outer_composite.py +petstore_api/model/outer_enum.py +petstore_api/model/outer_enum_default_value.py +petstore_api/model/outer_enum_integer.py +petstore_api/model/outer_enum_integer_default_value.py +petstore_api/model/parent_pet.py +petstore_api/model/pet.py +petstore_api/model/pig.py +petstore_api/model/quadrilateral.py +petstore_api/model/quadrilateral_interface.py +petstore_api/model/read_only_first.py +petstore_api/model/scalene_triangle.py +petstore_api/model/shape.py +petstore_api/model/shape_interface.py +petstore_api/model/shape_or_null.py +petstore_api/model/simple_quadrilateral.py +petstore_api/model/special_model_name.py +petstore_api/model/string_boolean_map.py +petstore_api/model/tag.py +petstore_api/model/triangle.py +petstore_api/model/triangle_interface.py +petstore_api/model/user.py +petstore_api/model/whale.py +petstore_api/model/zebra.py petstore_api/model_utils.py petstore_api/models/__init__.py -petstore_api/models/additional_properties_class.py -petstore_api/models/address.py -petstore_api/models/animal.py -petstore_api/models/api_response.py -petstore_api/models/apple.py -petstore_api/models/apple_req.py -petstore_api/models/array_of_array_of_number_only.py -petstore_api/models/array_of_number_only.py -petstore_api/models/array_test.py -petstore_api/models/banana.py -petstore_api/models/banana_req.py -petstore_api/models/basque_pig.py -petstore_api/models/capitalization.py -petstore_api/models/cat.py -petstore_api/models/cat_all_of.py -petstore_api/models/category.py -petstore_api/models/child_cat.py -petstore_api/models/child_cat_all_of.py -petstore_api/models/class_model.py -petstore_api/models/client.py -petstore_api/models/complex_quadrilateral.py -petstore_api/models/danish_pig.py -petstore_api/models/dog.py -petstore_api/models/dog_all_of.py -petstore_api/models/drawing.py -petstore_api/models/enum_arrays.py -petstore_api/models/enum_class.py -petstore_api/models/enum_test.py -petstore_api/models/equilateral_triangle.py -petstore_api/models/file.py -petstore_api/models/file_schema_test_class.py -petstore_api/models/foo.py -petstore_api/models/format_test.py -petstore_api/models/fruit.py -petstore_api/models/fruit_req.py -petstore_api/models/gm_fruit.py -petstore_api/models/grandparent_animal.py -petstore_api/models/has_only_read_only.py -petstore_api/models/health_check_result.py -petstore_api/models/inline_object.py -petstore_api/models/inline_object1.py -petstore_api/models/inline_object2.py -petstore_api/models/inline_object3.py -petstore_api/models/inline_object4.py -petstore_api/models/inline_object5.py -petstore_api/models/inline_response_default.py -petstore_api/models/isosceles_triangle.py -petstore_api/models/list.py -petstore_api/models/mammal.py -petstore_api/models/map_test.py -petstore_api/models/mixed_properties_and_additional_properties_class.py -petstore_api/models/model200_response.py -petstore_api/models/model_return.py -petstore_api/models/name.py -petstore_api/models/nullable_class.py -petstore_api/models/nullable_shape.py -petstore_api/models/number_only.py -petstore_api/models/order.py -petstore_api/models/outer_composite.py -petstore_api/models/outer_enum.py -petstore_api/models/outer_enum_default_value.py -petstore_api/models/outer_enum_integer.py -petstore_api/models/outer_enum_integer_default_value.py -petstore_api/models/parent_pet.py -petstore_api/models/pet.py -petstore_api/models/pig.py -petstore_api/models/quadrilateral.py -petstore_api/models/quadrilateral_interface.py -petstore_api/models/read_only_first.py -petstore_api/models/scalene_triangle.py -petstore_api/models/shape.py -petstore_api/models/shape_interface.py -petstore_api/models/shape_or_null.py -petstore_api/models/simple_quadrilateral.py -petstore_api/models/special_model_name.py -petstore_api/models/string_boolean_map.py -petstore_api/models/tag.py -petstore_api/models/triangle.py -petstore_api/models/triangle_interface.py -petstore_api/models/user.py -petstore_api/models/whale.py -petstore_api/models/zebra.py petstore_api/rest.py petstore_api/signing.py requirements.txt diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 9827e98d2a13..a542d727b93d 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -50,7 +50,8 @@ import datetime import time import petstore_api from pprint import pprint - +from petstore_api.api import another_fake_api +from petstore_api.model import client # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. configuration = petstore_api.Configuration( @@ -62,8 +63,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - client_client = petstore_api.Client() # client.Client | client model + api_instance = another_fake_api.AnotherFakeApi(api_client) + client_client = client.Client() # client.Client | client model try: # To test special tags @@ -71,7 +72,6 @@ with petstore_api.ApiClient(configuration) as api_client: pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) - ``` ## Documentation for API Endpoints @@ -253,3 +253,22 @@ Class | Method | HTTP request | Description +## Notes for Large OpenAPI documents +If the OpenAPI document is large, imports in petstore_api.apis and petstore_api.models may fail with a +RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: + +Solution 1: +Use specific imports for apis and models like: +- `from petstore_api.api.default_api import DefaultApi` +- `from petstore_api.model.pet import Pet` + +Solution 1: +Before importing the package, adjust the maximum recursion limit as shown below: +``` +import sys +sys.setrecursionlimit(1500) +import petstore_api +from petstore_api.apis import * +from petstore_api.models import * +``` + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md index 7b8b3d6796d0..4290afb9ab04 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -20,6 +20,8 @@ To test special tags and operation ID starting with number from __future__ import print_function import time import petstore_api +from petstore_api.api import another_fake_api +from petstore_api.model import client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -31,8 +33,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.AnotherFakeApi(api_client) - client_client = petstore_api.Client() # client.Client | client model + api_instance = another_fake_api.AnotherFakeApi(api_client) + client_client = client.Client() # client.Client | client model # example passing only required values which don't have defaults set try: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md index 91623f7a45ae..d5e28c8bc429 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -18,6 +18,8 @@ Method | HTTP request | Description from __future__ import print_function import time import petstore_api +from petstore_api.api import default_api +from petstore_api.model import inline_response_default from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -29,7 +31,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.DefaultApi(api_client) + api_instance = default_api.DefaultApi(api_client) # example, this endpoint has no required or optional parameters try: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index a31649db9aaf..6bd8936f1b5b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -31,6 +31,8 @@ Health check endpoint from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import health_check_result from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -42,7 +44,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) # example, this endpoint has no required or optional parameters try: @@ -89,6 +91,7 @@ Test serialization of outer boolean types from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -100,7 +103,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) body = True # bool | Input boolean as post body (optional) # example passing only required values which don't have defaults set @@ -151,6 +154,8 @@ Test serialization of object with outer number type from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import outer_composite from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -162,8 +167,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - outer_composite_outer_composite = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) + api_instance = fake_api.FakeApi(api_client) + outer_composite_outer_composite = outer_composite.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) # example passing only required values which don't have defaults set # and optional values @@ -213,6 +218,7 @@ Test serialization of outer number types from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -224,7 +230,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) body = 3.4 # float | Input number as post body (optional) # example passing only required values which don't have defaults set @@ -275,6 +281,7 @@ Test serialization of outer string types from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -286,7 +293,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) body = 'body_example' # str | Input string as post body (optional) # example passing only required values which don't have defaults set @@ -337,6 +344,8 @@ For this test, the body for this request much reference a schema named `File`. from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import file_schema_test_class from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -348,8 +357,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - file_schema_test_class_file_schema_test_class = petstore_api.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | + api_instance = fake_api.FakeApi(api_client) + file_schema_test_class_file_schema_test_class = file_schema_test_class.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | # example passing only required values which don't have defaults set try: @@ -395,6 +404,8 @@ No authorization required from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -406,9 +417,9 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) query = 'query_example' # str | - user_user = petstore_api.User() # user.User | + user_user = user.User() # user.User | # example passing only required values which don't have defaults set try: @@ -457,6 +468,8 @@ To test \"client\" model from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -468,8 +481,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) - client_client = petstore_api.Client() # client.Client | client model + api_instance = fake_api.FakeApi(api_client) + client_client = client.Client() # client.Client | client model # example passing only required values which don't have defaults set try: @@ -520,6 +533,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -541,7 +555,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) number = 3.4 # float | None double = 3.4 # float | None pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None @@ -626,6 +640,7 @@ To test enum parameters from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -637,7 +652,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' enum_query_string_array = ['enum_query_string_array_example'] # [str] | Query parameter enum test (string array) (optional) @@ -704,6 +719,7 @@ Fake endpoint to test group parameters (optional) from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -724,7 +740,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) required_string_group = 56 # int | Required String in group parameters required_boolean_group = True # bool | Required Boolean in group parameters required_int64_group = 56 # int | Required Integer in group parameters @@ -790,6 +806,7 @@ test inline additionalProperties from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -801,7 +818,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) request_body = {'key': 'request_body_example'} # {str: (str,)} | request body # example passing only required values which don't have defaults set @@ -849,6 +866,7 @@ test json serialization of form data from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -860,7 +878,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 @@ -912,6 +930,7 @@ To test the collection format in query parameters from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -923,7 +942,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeApi(api_client) + api_instance = fake_api.FakeApi(api_client) pipe = ['pipe_example'] # [str] | ioutil = ['ioutil_example'] # [str] | http = ['http_example'] # [str] | diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index ab1eb4d62ca8..3568b3be2399 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -21,6 +21,8 @@ To test class name in snake case from __future__ import print_function import time import petstore_api +from petstore_api.api import fake_classname_tags_123_api +from petstore_api.model import client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -46,8 +48,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.FakeClassnameTags123Api(api_client) - client_client = petstore_api.Client() # client.Client | client model + api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) + client_client = client.Client() # client.Client | client model # example passing only required values which don't have defaults set try: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index 62bcfdd1bdd1..a5344a30f168 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -27,6 +27,8 @@ Add a new pet to the store from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -108,8 +110,8 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + api_instance = pet_api.PetApi(api_client) + pet_pet = pet.Pet() # pet.Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: @@ -157,6 +159,7 @@ Deletes a pet from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -178,7 +181,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) pet_id = 56 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) @@ -239,6 +242,8 @@ Multiple status values can be provided with comma separated strings from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -320,7 +325,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) status = ['status_example'] # [str] | Status values that need to be considered for filter # example passing only required values which don't have defaults set @@ -373,6 +378,8 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -454,7 +461,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) tags = ['tags_example'] # [str] | Tags to filter by # example passing only required values which don't have defaults set @@ -507,6 +514,8 @@ Returns a single pet from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -532,7 +541,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) pet_id = 56 # int | ID of pet to return # example passing only required values which don't have defaults set @@ -584,6 +593,8 @@ Update an existing pet from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -665,8 +676,8 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) - pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + api_instance = pet_api.PetApi(api_client) + pet_pet = pet.Pet() # pet.Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: @@ -716,6 +727,7 @@ Updates a pet in the store with form data from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -737,7 +749,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) pet_id = 56 # int | ID of pet that needs to be updated name = 'name_example' # str | Updated name of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional) @@ -798,6 +810,8 @@ uploads an image from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import api_response from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -819,7 +833,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) pet_id = 56 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) file = open('/path/to/file', 'rb') # file_type | file to upload (optional) @@ -882,6 +896,8 @@ uploads an image (required) from __future__ import print_function import time import petstore_api +from petstore_api.api import pet_api +from petstore_api.model import api_response from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -903,7 +919,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.PetApi(api_client) + api_instance = pet_api.PetApi(api_client) pet_id = 56 # int | ID of pet to update required_file = open('/path/to/file', 'rb') # file_type | file to upload additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md index 4a7b890a1cc1..2cebd103e1f8 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -23,6 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non from __future__ import print_function import time import petstore_api +from petstore_api.api import store_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -34,7 +35,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) + api_instance = store_api.StoreApi(api_client) order_id = 'order_id_example' # str | ID of the order that needs to be deleted # example passing only required values which don't have defaults set @@ -86,6 +87,7 @@ Returns a map of status codes to quantities from __future__ import print_function import time import petstore_api +from petstore_api.api import store_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -111,7 +113,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) + api_instance = store_api.StoreApi(api_client) # example, this endpoint has no required or optional parameters try: @@ -158,6 +160,8 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge from __future__ import print_function import time import petstore_api +from petstore_api.api import store_api +from petstore_api.model import order from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -169,7 +173,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) + api_instance = store_api.StoreApi(api_client) order_id = 56 # int | ID of pet that needs to be fetched # example passing only required values which don't have defaults set @@ -220,6 +224,8 @@ Place an order for a pet from __future__ import print_function import time import petstore_api +from petstore_api.api import store_api +from petstore_api.model import order from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -231,8 +237,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.StoreApi(api_client) - order_order = petstore_api.Order() # order.Order | order placed for purchasing the pet + api_instance = store_api.StoreApi(api_client) + order_order = order.Order() # order.Order | order placed for purchasing the pet # example passing only required values which don't have defaults set try: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md index 4aa31e100bb0..ffcdef6d343c 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -27,6 +27,8 @@ This can only be done by the logged in user. from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -38,8 +40,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - user_user = petstore_api.User() # user.User | Created user object + api_instance = user_api.UserApi(api_client) + user_user = user.User() # user.User | Created user object # example passing only required values which don't have defaults set try: @@ -86,6 +88,8 @@ Creates list of users with given input array from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -97,8 +101,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - user_user = [petstore_api.User()] # [user.User] | List of user object + api_instance = user_api.UserApi(api_client) + user_user = [user.User()] # [user.User] | List of user object # example passing only required values which don't have defaults set try: @@ -145,6 +149,8 @@ Creates list of users with given input array from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -156,8 +162,8 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) - user_user = [petstore_api.User()] # [user.User] | List of user object + api_instance = user_api.UserApi(api_client) + user_user = [user.User()] # [user.User] | List of user object # example passing only required values which don't have defaults set try: @@ -206,6 +212,7 @@ This can only be done by the logged in user. from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -217,7 +224,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) + api_instance = user_api.UserApi(api_client) username = 'username_example' # str | The name that needs to be deleted # example passing only required values which don't have defaults set @@ -266,6 +273,8 @@ Get user by user name from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -277,7 +286,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) + api_instance = user_api.UserApi(api_client) username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. # example passing only required values which don't have defaults set @@ -328,6 +337,7 @@ Logs user into the system from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -339,7 +349,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) + api_instance = user_api.UserApi(api_client) username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text @@ -391,6 +401,7 @@ Logs out current logged in user session from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -402,7 +413,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) + api_instance = user_api.UserApi(api_client) # example, this endpoint has no required or optional parameters try: @@ -448,6 +459,8 @@ This can only be done by the logged in user. from __future__ import print_function import time import petstore_api +from petstore_api.api import user_api +from petstore_api.model import user from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -459,9 +472,9 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: # Create an instance of the API class - api_instance = petstore_api.UserApi(api_client) + api_instance = user_api.UserApi(api_client) username = 'username_example' # str | name that need to be deleted - user_user = petstore_api.User() # user.User | Updated user object + user_user = user.User() # user.User | Updated user object # example passing only required values which don't have defaults set try: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py index 8b945d032fbe..fb7630e30d59 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -16,15 +16,6 @@ __version__ = "1.0.0" -# import apis into sdk package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.default_api import DefaultApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi - # import ApiClient from petstore_api.api_client import ApiClient @@ -34,91 +25,8 @@ # import exceptions from petstore_api.exceptions import OpenApiException +from petstore_api.exceptions import ApiAttributeError from petstore_api.exceptions import ApiTypeError from petstore_api.exceptions import ApiValueError from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiException - -# import models into sdk package -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.address import Address -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.apple import Apple -from petstore_api.models.apple_req import AppleReq -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.banana import Banana -from petstore_api.models.banana_req import BananaReq -from petstore_api.models.basque_pig import BasquePig -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.child_cat import ChildCat -from petstore_api.models.child_cat_all_of import ChildCatAllOf -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.complex_quadrilateral import ComplexQuadrilateral -from petstore_api.models.danish_pig import DanishPig -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.drawing import Drawing -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.equilateral_triangle import EquilateralTriangle -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.foo import Foo -from petstore_api.models.format_test import FormatTest -from petstore_api.models.fruit import Fruit -from petstore_api.models.fruit_req import FruitReq -from petstore_api.models.gm_fruit import GmFruit -from petstore_api.models.grandparent_animal import GrandparentAnimal -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.health_check_result import HealthCheckResult -from petstore_api.models.inline_object import InlineObject -from petstore_api.models.inline_object1 import InlineObject1 -from petstore_api.models.inline_object2 import InlineObject2 -from petstore_api.models.inline_object3 import InlineObject3 -from petstore_api.models.inline_object4 import InlineObject4 -from petstore_api.models.inline_object5 import InlineObject5 -from petstore_api.models.inline_response_default import InlineResponseDefault -from petstore_api.models.isosceles_triangle import IsoscelesTriangle -from petstore_api.models.list import List -from petstore_api.models.mammal import Mammal -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.nullable_class import NullableClass -from petstore_api.models.nullable_shape import NullableShape -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue -from petstore_api.models.outer_enum_integer import OuterEnumInteger -from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue -from petstore_api.models.parent_pet import ParentPet -from petstore_api.models.pet import Pet -from petstore_api.models.pig import Pig -from petstore_api.models.quadrilateral import Quadrilateral -from petstore_api.models.quadrilateral_interface import QuadrilateralInterface -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.scalene_triangle import ScaleneTriangle -from petstore_api.models.shape import Shape -from petstore_api.models.shape_interface import ShapeInterface -from petstore_api.models.shape_or_null import ShapeOrNull -from petstore_api.models.simple_quadrilateral import SimpleQuadrilateral -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.string_boolean_map import StringBooleanMap -from petstore_api.models.tag import Tag -from petstore_api.models.triangle import Triangle -from petstore_api.models.triangle_interface import TriangleInterface -from petstore_api.models.user import User -from petstore_api.models.whale import Whale -from petstore_api.models.zebra import Zebra +from petstore_api.exceptions import ApiException \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index 6c7e40c24825..cb2881b7ae8c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -34,7 +34,7 @@ str, validate_and_convert_types ) -from petstore_api.models import client +from petstore_api.model import client class AnotherFakeApi(object): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py index 3e46d7928cb5..25c8e40e5252 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -34,7 +34,7 @@ str, validate_and_convert_types ) -from petstore_api.models import inline_response_default +from petstore_api.model import inline_response_default class DefaultApi(object): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py index fd5096ba6de1..69531b0525fa 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -34,11 +34,11 @@ str, validate_and_convert_types ) -from petstore_api.models import health_check_result -from petstore_api.models import outer_composite -from petstore_api.models import file_schema_test_class -from petstore_api.models import user -from petstore_api.models import client +from petstore_api.model import health_check_result +from petstore_api.model import outer_composite +from petstore_api.model import file_schema_test_class +from petstore_api.model import user +from petstore_api.model import client class FakeApi(object): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index f2a13a0b92fd..2ed92b4d0f33 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -34,7 +34,7 @@ str, validate_and_convert_types ) -from petstore_api.models import client +from petstore_api.model import client class FakeClassnameTags123Api(object): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py index 1a0fdb48bf4c..9ccaf11c268d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -34,8 +34,8 @@ str, validate_and_convert_types ) -from petstore_api.models import pet -from petstore_api.models import api_response +from petstore_api.model import pet +from petstore_api.model import api_response class PetApi(object): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py index 46fce50d29d3..67648f5ee722 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -34,7 +34,7 @@ str, validate_and_convert_types ) -from petstore_api.models import order +from petstore_api.model import order class StoreApi(object): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py index e354babbfe5c..e5f5ffe886c9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -34,7 +34,7 @@ str, validate_and_convert_types ) -from petstore_api.models import user +from petstore_api.model import user class UserApi(object): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py new file mode 100644 index 000000000000..41cbd0aa055e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/apis/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +# flake8: noqa + +# import all apis into this package +# if you have many ampis here with many many models used in each api this may +# raise a RecursionError +# to avoid this, import only the api that you directly need like: +# from .api.pet_api import PetApi +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +# import apis into api package +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.default_api import DefaultApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/__init__.py new file mode 100644 index 000000000000..cfe32b784926 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/__init__.py @@ -0,0 +1,5 @@ +# we can not import model classes here because that would create a circular +# reference which would not work in python2 +# do not import all models into this module because that uses a lot of memory and stack frames +# if you need the ability to import all models from one package, import them with +# from {{packageName}.models import ModelA, ModelB diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/address.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py index 641c9c16e279..7ba62dad1622 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import cat + from petstore_api.model import cat except ImportError: cat = sys.modules[ - 'petstore_api.models.cat'] + 'petstore_api.model.cat'] try: - from petstore_api.models import dog + from petstore_api.model import dog except ImportError: dog = sys.modules[ - 'petstore_api.models.dog'] + 'petstore_api.model.dog'] class Animal(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple_req.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/models/array_test.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py index 0eed8d054611..e2bc76832b27 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import read_only_first + from petstore_api.model import read_only_first except ImportError: read_only_first = sys.modules[ - 'petstore_api.models.read_only_first'] + 'petstore_api.model.read_only_first'] class ArrayTest(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana_req.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/basque_pig.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py index b80672252538..ab01b1f0a9c5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -34,20 +34,20 @@ validate_get_composed_info, ) try: - from petstore_api.models import address + from petstore_api.model import address except ImportError: address = sys.modules[ - 'petstore_api.models.address'] + 'petstore_api.model.address'] try: - from petstore_api.models import animal + from petstore_api.model import animal except ImportError: animal = sys.modules[ - 'petstore_api.models.animal'] + 'petstore_api.model.animal'] try: - from petstore_api.models import cat_all_of + from petstore_api.model import cat_all_of except ImportError: cat_all_of = sys.modules[ - 'petstore_api.models.cat_all_of'] + 'petstore_api.model.cat_all_of'] class Cat(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/child_cat.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py index f838e61b4014..996f3e0098e2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import child_cat_all_of + from petstore_api.model import child_cat_all_of except ImportError: child_cat_all_of = sys.modules[ - 'petstore_api.models.child_cat_all_of'] + 'petstore_api.model.child_cat_all_of'] try: - from petstore_api.models import parent_pet + from petstore_api.model import parent_pet except ImportError: parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + 'petstore_api.model.parent_pet'] class ChildCat(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/child_cat_all_of.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/complex_quadrilateral.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py index 03497b55fb45..7cc5a70032a0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import quadrilateral_interface + from petstore_api.model import quadrilateral_interface except ImportError: quadrilateral_interface = sys.modules[ - 'petstore_api.models.quadrilateral_interface'] + 'petstore_api.model.quadrilateral_interface'] try: - from petstore_api.models import shape_interface + from petstore_api.model import shape_interface except ImportError: shape_interface = sys.modules[ - 'petstore_api.models.shape_interface'] + 'petstore_api.model.shape_interface'] class ComplexQuadrilateral(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/danish_pig.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py index e35c52bd69d0..a100eb3c70ef 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import animal + from petstore_api.model import animal except ImportError: animal = sys.modules[ - 'petstore_api.models.animal'] + 'petstore_api.model.animal'] try: - from petstore_api.models import dog_all_of + from petstore_api.model import dog_all_of except ImportError: dog_all_of = sys.modules[ - 'petstore_api.models.dog_all_of'] + 'petstore_api.model.dog_all_of'] class Dog(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py similarity index 95% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/drawing.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py index a9cf39773d6b..8d61b20887d1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -34,25 +34,25 @@ validate_get_composed_info, ) try: - from petstore_api.models import fruit + from petstore_api.model import fruit except ImportError: fruit = sys.modules[ - 'petstore_api.models.fruit'] + 'petstore_api.model.fruit'] try: - from petstore_api.models import nullable_shape + from petstore_api.model import nullable_shape except ImportError: nullable_shape = sys.modules[ - 'petstore_api.models.nullable_shape'] + 'petstore_api.model.nullable_shape'] try: - from petstore_api.models import shape + from petstore_api.model import shape except ImportError: shape = sys.modules[ - 'petstore_api.models.shape'] + 'petstore_api.model.shape'] try: - from petstore_api.models import shape_or_null + from petstore_api.model import shape_or_null except ImportError: shape_or_null = sys.modules[ - 'petstore_api.models.shape_or_null'] + 'petstore_api.model.shape_or_null'] class Drawing(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py similarity index 95% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index ba6118114b07..1320cc416e7d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -34,25 +34,25 @@ validate_get_composed_info, ) try: - from petstore_api.models import outer_enum + from petstore_api.model import outer_enum except ImportError: outer_enum = sys.modules[ - 'petstore_api.models.outer_enum'] + 'petstore_api.model.outer_enum'] try: - from petstore_api.models import outer_enum_default_value + from petstore_api.model import outer_enum_default_value except ImportError: outer_enum_default_value = sys.modules[ - 'petstore_api.models.outer_enum_default_value'] + 'petstore_api.model.outer_enum_default_value'] try: - from petstore_api.models import outer_enum_integer + from petstore_api.model import outer_enum_integer except ImportError: outer_enum_integer = sys.modules[ - 'petstore_api.models.outer_enum_integer'] + 'petstore_api.model.outer_enum_integer'] try: - from petstore_api.models import outer_enum_integer_default_value + from petstore_api.model import outer_enum_integer_default_value except ImportError: outer_enum_integer_default_value = sys.modules[ - 'petstore_api.models.outer_enum_integer_default_value'] + 'petstore_api.model.outer_enum_integer_default_value'] class EnumTest(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/equilateral_triangle.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py index c601d01dde7f..44f69a5dced7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import shape_interface + from petstore_api.model import shape_interface except ImportError: shape_interface = sys.modules[ - 'petstore_api.models.shape_interface'] + 'petstore_api.model.shape_interface'] try: - from petstore_api.models import triangle_interface + from petstore_api.model import triangle_interface except ImportError: triangle_interface = sys.modules[ - 'petstore_api.models.triangle_interface'] + 'petstore_api.model.triangle_interface'] class EquilateralTriangle(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 79e5638ccc94..0a9471e9e420 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import file + from petstore_api.model import file except ImportError: file = sys.modules[ - 'petstore_api.models.file'] + 'petstore_api.model.file'] class FileSchemaTestClass(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py index 1058c953ee60..244497b64a10 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import apple + from petstore_api.model import apple except ImportError: apple = sys.modules[ - 'petstore_api.models.apple'] + 'petstore_api.model.apple'] try: - from petstore_api.models import banana + from petstore_api.model import banana except ImportError: banana = sys.modules[ - 'petstore_api.models.banana'] + 'petstore_api.model.banana'] class Fruit(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit_req.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py index b8af0f35f432..11a7615749cc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import apple_req + from petstore_api.model import apple_req except ImportError: apple_req = sys.modules[ - 'petstore_api.models.apple_req'] + 'petstore_api.model.apple_req'] try: - from petstore_api.models import banana_req + from petstore_api.model import banana_req except ImportError: banana_req = sys.modules[ - 'petstore_api.models.banana_req'] + 'petstore_api.model.banana_req'] class FruitReq(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_fruit.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py index 9857b08c36c6..e2ebe6fd9d17 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import apple + from petstore_api.model import apple except ImportError: apple = sys.modules[ - 'petstore_api.models.apple'] + 'petstore_api.model.apple'] try: - from petstore_api.models import banana + from petstore_api.model import banana except ImportError: banana = sys.modules[ - 'petstore_api.models.banana'] + 'petstore_api.model.banana'] class GmFruit(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index ab2ba56caf37..b5af666f7530 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import child_cat + from petstore_api.model import child_cat except ImportError: child_cat = sys.modules[ - 'petstore_api.models.child_cat'] + 'petstore_api.model.child_cat'] try: - from petstore_api.models import parent_pet + from petstore_api.model import parent_pet except ImportError: parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + 'petstore_api.model.parent_pet'] class GrandparentAnimal(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py index 577dbfeb8517..f3abf4a7a193 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import foo + from petstore_api.model import foo except ImportError: foo = sys.modules[ - 'petstore_api.models.foo'] + 'petstore_api.model.foo'] class InlineResponseDefault(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/isosceles_triangle.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py index ea5607fdfd9b..40c8878bb003 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import shape_interface + from petstore_api.model import shape_interface except ImportError: shape_interface = sys.modules[ - 'petstore_api.models.shape_interface'] + 'petstore_api.model.shape_interface'] try: - from petstore_api.models import triangle_interface + from petstore_api.model import triangle_interface except ImportError: triangle_interface = sys.modules[ - 'petstore_api.models.triangle_interface'] + 'petstore_api.model.triangle_interface'] class IsoscelesTriangle(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py index 44f3e402c981..e0b9f314080d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -34,20 +34,20 @@ validate_get_composed_info, ) try: - from petstore_api.models import pig + from petstore_api.model import pig except ImportError: pig = sys.modules[ - 'petstore_api.models.pig'] + 'petstore_api.model.pig'] try: - from petstore_api.models import whale + from petstore_api.model import whale except ImportError: whale = sys.modules[ - 'petstore_api.models.whale'] + 'petstore_api.model.whale'] try: - from petstore_api.models import zebra + from petstore_api.model import zebra except ImportError: zebra = sys.modules[ - 'petstore_api.models.zebra'] + 'petstore_api.model.zebra'] class Mammal(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py index 45be8a1fecfd..a22af06ce4fd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import string_boolean_map + from petstore_api.model import string_boolean_map except ImportError: string_boolean_map = sys.modules[ - 'petstore_api.models.string_boolean_map'] + 'petstore_api.model.string_boolean_map'] class MapTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index 0e584ebd43e9..a0fcac2eb019 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.models import animal + from petstore_api.model import animal except ImportError: animal = sys.modules[ - 'petstore_api.models.animal'] + 'petstore_api.model.animal'] class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_shape.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index e62a3881c520..77778126a6f7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import quadrilateral + from petstore_api.model import quadrilateral except ImportError: quadrilateral = sys.modules[ - 'petstore_api.models.quadrilateral'] + 'petstore_api.model.quadrilateral'] try: - from petstore_api.models import triangle + from petstore_api.model import triangle except ImportError: triangle = sys.modules[ - 'petstore_api.models.triangle'] + 'petstore_api.model.triangle'] class NullableShape(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_composite.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_composite.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_default_value.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_default_value.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer_default_value.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer_default_value.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/parent_pet.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py index 89633120977e..26a44926fa3e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import child_cat + from petstore_api.model import child_cat except ImportError: child_cat = sys.modules[ - 'petstore_api.models.child_cat'] + 'petstore_api.model.child_cat'] try: - from petstore_api.models import grandparent_animal + from petstore_api.model import grandparent_animal except ImportError: grandparent_animal = sys.modules[ - 'petstore_api.models.grandparent_animal'] + 'petstore_api.model.grandparent_animal'] class ParentPet(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py similarity index 97% rename from samples/client/petstore/python-experimental/petstore_api/models/pet.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py index c93acd53c96c..742d7cdf04a8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import category + from petstore_api.model import category except ImportError: category = sys.modules[ - 'petstore_api.models.category'] + 'petstore_api.model.category'] try: - from petstore_api.models import tag + from petstore_api.model import tag except ImportError: tag = sys.modules[ - 'petstore_api.models.tag'] + 'petstore_api.model.tag'] class Pet(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/pig.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py index 5dd3fdb64ec1..2e02e4e88c98 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import basque_pig + from petstore_api.model import basque_pig except ImportError: basque_pig = sys.modules[ - 'petstore_api.models.basque_pig'] + 'petstore_api.model.basque_pig'] try: - from petstore_api.models import danish_pig + from petstore_api.model import danish_pig except ImportError: danish_pig = sys.modules[ - 'petstore_api.models.danish_pig'] + 'petstore_api.model.danish_pig'] class Pig(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py index 0f4994064571..b0766c987164 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import complex_quadrilateral + from petstore_api.model import complex_quadrilateral except ImportError: complex_quadrilateral = sys.modules[ - 'petstore_api.models.complex_quadrilateral'] + 'petstore_api.model.complex_quadrilateral'] try: - from petstore_api.models import simple_quadrilateral + from petstore_api.model import simple_quadrilateral except ImportError: simple_quadrilateral = sys.modules[ - 'petstore_api.models.simple_quadrilateral'] + 'petstore_api.model.simple_quadrilateral'] class Quadrilateral(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral_interface.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/scalene_triangle.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py index 6350bdea3bc5..2c58f1bb99ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import shape_interface + from petstore_api.model import shape_interface except ImportError: shape_interface = sys.modules[ - 'petstore_api.models.shape_interface'] + 'petstore_api.model.shape_interface'] try: - from petstore_api.models import triangle_interface + from petstore_api.model import triangle_interface except ImportError: triangle_interface = sys.modules[ - 'petstore_api.models.triangle_interface'] + 'petstore_api.model.triangle_interface'] class ScaleneTriangle(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py index ef83ed3a31b7..9eec4b7705ed 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import quadrilateral + from petstore_api.model import quadrilateral except ImportError: quadrilateral = sys.modules[ - 'petstore_api.models.quadrilateral'] + 'petstore_api.model.quadrilateral'] try: - from petstore_api.models import triangle + from petstore_api.model import triangle except ImportError: triangle = sys.modules[ - 'petstore_api.models.triangle'] + 'petstore_api.model.triangle'] class Shape(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_interface.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_or_null.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py index 53043fdd60c4..8c00f44dfaac 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import quadrilateral + from petstore_api.model import quadrilateral except ImportError: quadrilateral = sys.modules[ - 'petstore_api.models.quadrilateral'] + 'petstore_api.model.quadrilateral'] try: - from petstore_api.models import triangle + from petstore_api.model import triangle except ImportError: triangle = sys.modules[ - 'petstore_api.models.triangle'] + 'petstore_api.model.triangle'] class ShapeOrNull(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/simple_quadrilateral.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py index 8d8cf85fca1e..dd27bd66fea7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -34,15 +34,15 @@ validate_get_composed_info, ) try: - from petstore_api.models import quadrilateral_interface + from petstore_api.model import quadrilateral_interface except ImportError: quadrilateral_interface = sys.modules[ - 'petstore_api.models.quadrilateral_interface'] + 'petstore_api.model.quadrilateral_interface'] try: - from petstore_api.models import shape_interface + from petstore_api.model import shape_interface except ImportError: shape_interface = sys.modules[ - 'petstore_api.models.shape_interface'] + 'petstore_api.model.shape_interface'] class SimpleQuadrilateral(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py similarity index 96% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py index 27b8ae122733..52c3218db1e3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -34,20 +34,20 @@ validate_get_composed_info, ) try: - from petstore_api.models import equilateral_triangle + from petstore_api.model import equilateral_triangle except ImportError: equilateral_triangle = sys.modules[ - 'petstore_api.models.equilateral_triangle'] + 'petstore_api.model.equilateral_triangle'] try: - from petstore_api.models import isosceles_triangle + from petstore_api.model import isosceles_triangle except ImportError: isosceles_triangle = sys.modules[ - 'petstore_api.models.isosceles_triangle'] + 'petstore_api.model.isosceles_triangle'] try: - from petstore_api.models import scalene_triangle + from petstore_api.model import scalene_triangle except ImportError: scalene_triangle = sys.modules[ - 'petstore_api.models.scalene_triangle'] + 'petstore_api.model.scalene_triangle'] class Triangle(ModelComposed): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle_interface.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/whale.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/models/zebra.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py index e02c66519259..7c58ced9f86a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -1,15 +1,95 @@ # coding: utf-8 # flake8: noqa -""" - OpenAPI Petstore - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from petstore_api.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -# we can not import model classes here because that would create a circular -# reference which would not work in python2 +from petstore_api.model.additional_properties_class import AdditionalPropertiesClass +from petstore_api.model.address import Address +from petstore_api.model.animal import Animal +from petstore_api.model.api_response import ApiResponse +from petstore_api.model.apple import Apple +from petstore_api.model.apple_req import AppleReq +from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.model.array_of_number_only import ArrayOfNumberOnly +from petstore_api.model.array_test import ArrayTest +from petstore_api.model.banana import Banana +from petstore_api.model.banana_req import BananaReq +from petstore_api.model.basque_pig import BasquePig +from petstore_api.model.capitalization import Capitalization +from petstore_api.model.cat import Cat +from petstore_api.model.cat_all_of import CatAllOf +from petstore_api.model.category import Category +from petstore_api.model.child_cat import ChildCat +from petstore_api.model.child_cat_all_of import ChildCatAllOf +from petstore_api.model.class_model import ClassModel +from petstore_api.model.client import Client +from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral +from petstore_api.model.danish_pig import DanishPig +from petstore_api.model.dog import Dog +from petstore_api.model.dog_all_of import DogAllOf +from petstore_api.model.drawing import Drawing +from petstore_api.model.enum_arrays import EnumArrays +from petstore_api.model.enum_class import EnumClass +from petstore_api.model.enum_test import EnumTest +from petstore_api.model.equilateral_triangle import EquilateralTriangle +from petstore_api.model.file import File +from petstore_api.model.file_schema_test_class import FileSchemaTestClass +from petstore_api.model.foo import Foo +from petstore_api.model.format_test import FormatTest +from petstore_api.model.fruit import Fruit +from petstore_api.model.fruit_req import FruitReq +from petstore_api.model.gm_fruit import GmFruit +from petstore_api.model.grandparent_animal import GrandparentAnimal +from petstore_api.model.has_only_read_only import HasOnlyReadOnly +from petstore_api.model.health_check_result import HealthCheckResult +from petstore_api.model.inline_object import InlineObject +from petstore_api.model.inline_object1 import InlineObject1 +from petstore_api.model.inline_object2 import InlineObject2 +from petstore_api.model.inline_object3 import InlineObject3 +from petstore_api.model.inline_object4 import InlineObject4 +from petstore_api.model.inline_object5 import InlineObject5 +from petstore_api.model.inline_response_default import InlineResponseDefault +from petstore_api.model.isosceles_triangle import IsoscelesTriangle +from petstore_api.model.list import List +from petstore_api.model.mammal import Mammal +from petstore_api.model.map_test import MapTest +from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.model.model200_response import Model200Response +from petstore_api.model.model_return import ModelReturn +from petstore_api.model.name import Name +from petstore_api.model.nullable_class import NullableClass +from petstore_api.model.nullable_shape import NullableShape +from petstore_api.model.number_only import NumberOnly +from petstore_api.model.order import Order +from petstore_api.model.outer_composite import OuterComposite +from petstore_api.model.outer_enum import OuterEnum +from petstore_api.model.outer_enum_default_value import OuterEnumDefaultValue +from petstore_api.model.outer_enum_integer import OuterEnumInteger +from petstore_api.model.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue +from petstore_api.model.parent_pet import ParentPet +from petstore_api.model.pet import Pet +from petstore_api.model.pig import Pig +from petstore_api.model.quadrilateral import Quadrilateral +from petstore_api.model.quadrilateral_interface import QuadrilateralInterface +from petstore_api.model.read_only_first import ReadOnlyFirst +from petstore_api.model.scalene_triangle import ScaleneTriangle +from petstore_api.model.shape import Shape +from petstore_api.model.shape_interface import ShapeInterface +from petstore_api.model.shape_or_null import ShapeOrNull +from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral +from petstore_api.model.special_model_name import SpecialModelName +from petstore_api.model.string_boolean_map import StringBooleanMap +from petstore_api.model.tag import Tag +from petstore_api.model.triangle import Triangle +from petstore_api.model.triangle_interface import TriangleInterface +from petstore_api.model.user import User +from petstore_api.model.whale import Whale +from petstore_api.model.zebra import Zebra diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_mammal.py deleted file mode 100644 index 40d056a494ec..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_mammal.py +++ /dev/null @@ -1,212 +0,0 @@ -# coding: utf-8 - -""" - OpenAPI Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import -import re # noqa: F401 -import sys # noqa: F401 - -import six # noqa: F401 - -from petstore_api.model_utils import ( # noqa: F401 - ModelComposed, - ModelNormal, - ModelSimple, - date, - datetime, - file_type, - int, - none_type, - str, - validate_get_composed_info, -) -try: - from petstore_api.models import whale -except ImportError: - whale = sys.modules[ - 'petstore_api.models.whale'] -try: - from petstore_api.models import zebra -except ImportError: - zebra = sys.modules[ - 'petstore_api.models.zebra'] - - -class GmMammal(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('lungs',): { - '2': 2, - }, - ('type',): { - 'PLAINS': "plains", - 'MOUNTAIN': "mountain", - 'GREVYS': "grevys", - }, - } - - validations = { - } - - additional_properties_type = None - - @staticmethod - def openapi_types(): - """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'class_name': (str,), # noqa: E501 - 'lungs': (int,), # noqa: E501 - 'has_baleen': (bool,), # noqa: E501 - 'has_teeth': (bool,), # noqa: E501 - 'type': (str,), # noqa: E501 - } - - @staticmethod - def discriminator(): - return { - 'class_name': { - 'whale': whale.Whale, - 'zebra': zebra.Zebra, - }, - } - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'lungs': 'lungs', # noqa: E501 - 'has_baleen': 'hasBaleen', # noqa: E501 - 'has_teeth': 'hasTeeth', # noqa: E501 - 'type': 'type', # noqa: E501 - } - - required_properties = set([ - '_data_store', - '_check_type', - '_json_variable_naming', - '_path_to_item', - '_configuration', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - def __init__(self, class_name, _check_type=True, _json_variable_naming=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """gm_mammal.GmMammal - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _json_variable_naming (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - lungs (int): [optional] if omitted the server will use the default value of 2 # noqa: E501 - has_baleen (bool): [optional] # noqa: E501 - has_teeth (bool): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - """ - - self._data_store = {} - self._check_type = _check_type - self._json_variable_naming = _json_variable_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_json_variable_naming': _json_variable_naming, - '_configuration': _configuration, - } - model_args = { - 'class_name': class_name, - } - model_args.update(kwargs) - composed_info = validate_get_composed_info( - constant_args, model_args, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - - self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): - setattr(self, var_name, var_value) - - @staticmethod - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - return { - 'anyOf': [ - whale.Whale, - zebra.Zebra, - ], - 'allOf': [ - ], - 'oneOf': [ - ], - } - - @classmethod - def get_discriminator_class(cls, json_variable_naming, data): - """Returns the child class specified by the discriminator""" - discriminator = cls.discriminator() - discr_propertyname_py = list(discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if json_variable_naming: - class_name = data[discr_propertyname_js] - else: - class_name = data[discr_propertyname_py] - class_name_to_discr_class = discriminator[discr_propertyname_py] - return class_name_to_discr_class.get(class_name) diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py index 279baa3a454f..befc14455da2 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.additional_properties_class import AdditionalPropertiesClass class TestAdditionalPropertiesClass(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testAdditionalPropertiesClass(self): """Test AdditionalPropertiesClass""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.AdditionalPropertiesClass() # noqa: E501 + # model = AdditionalPropertiesClass() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_address.py b/samples/openapi3/client/petstore/python-experimental/test/test_address.py index 7aa36d745cf5..dcc33c22dbb3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_address.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_address.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.address import Address class TestAddress(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testAddress(self): """Test Address""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Address() # noqa: E501 + # model = Address() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py index 66f94c5eef4e..958f303f13e3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import cat +except ImportError: + cat = sys.modules[ + 'petstore_api.model.cat'] +try: + from petstore_api.model import dog +except ImportError: + dog = sys.modules[ + 'petstore_api.model.dog'] +from petstore_api.model.animal import Animal class TestAnimal(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testAnimal(self): """Test Animal""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Animal() # noqa: E501 + # model = Animal() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py index d95798cfc5a4..f79966a26961 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py @@ -16,14 +16,13 @@ import petstore_api from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 -from petstore_api.rest import ApiException class TestAnotherFakeApi(unittest.TestCase): """AnotherFakeApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 + self.api = AnotherFakeApi() # noqa: E501 def tearDown(self): pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py index a253e6f364cd..9db92633f626 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.api_response import ApiResponse class TestApiResponse(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testApiResponse(self): """Test ApiResponse""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ApiResponse() # noqa: E501 + # model = ApiResponse() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_apple.py b/samples/openapi3/client/petstore/python-experimental/test/test_apple.py index 100866918919..9aedfc0b01d5 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_apple.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_apple.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.apple import Apple class TestApple(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testApple(self): """Test Apple""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Apple() # noqa: E501 + # model = Apple() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py index 4cb5abcdede4..79650cd1c747 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.apple_req import AppleReq class TestAppleReq(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testAppleReq(self): """Test AppleReq""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.AppleReq() # noqa: E501 + # model = AppleReq() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py index e47430f6861a..4980ad17afb5 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly class TestArrayOfArrayOfNumberOnly(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testArrayOfArrayOfNumberOnly(self): """Test ArrayOfArrayOfNumberOnly""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ArrayOfArrayOfNumberOnly() # noqa: E501 + # model = ArrayOfArrayOfNumberOnly() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py index 1a65f69b9268..479c537cada7 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.array_of_number_only import ArrayOfNumberOnly class TestArrayOfNumberOnly(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testArrayOfNumberOnly(self): """Test ArrayOfNumberOnly""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ArrayOfNumberOnly() # noqa: E501 + # model = ArrayOfNumberOnly() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py index ac1b486bb74e..2426b27b7e46 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py @@ -11,10 +11,16 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import read_only_first +except ImportError: + read_only_first = sys.modules[ + 'petstore_api.model.read_only_first'] +from petstore_api.model.array_test import ArrayTest class TestArrayTest(unittest.TestCase): @@ -29,7 +35,7 @@ def tearDown(self): def testArrayTest(self): """Test ArrayTest""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ArrayTest() # noqa: E501 + # model = ArrayTest() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_banana.py b/samples/openapi3/client/petstore/python-experimental/test/test_banana.py index 6efdcd07da1c..a989386b018c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_banana.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_banana.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.banana import Banana class TestBanana(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testBanana(self): """Test Banana""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Banana() # noqa: E501 + # model = Banana() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py index 5eeb0bc57c21..39d125e4a15e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.banana_req import BananaReq class TestBananaReq(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testBananaReq(self): """Test BananaReq""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.BananaReq() # noqa: E501 + # model = BananaReq() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py b/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py index 46e9ff215dc8..b00c5f8a6aa5 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.basque_pig import BasquePig class TestBasquePig(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testBasquePig(self): """Test BasquePig""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.BasquePig() # noqa: E501 + # model = BasquePig() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py index 1cb91380a768..20d2649c01eb 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.capitalization import Capitalization class TestCapitalization(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testCapitalization(self): """Test Capitalization""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Capitalization() # noqa: E501 + # model = Capitalization() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py index bd616261861d..1cb6b58cbd09 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py @@ -11,10 +11,26 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import address +except ImportError: + address = sys.modules[ + 'petstore_api.model.address'] +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +try: + from petstore_api.model import cat_all_of +except ImportError: + cat_all_of = sys.modules[ + 'petstore_api.model.cat_all_of'] +from petstore_api.model.cat import Cat class TestCat(unittest.TestCase): @@ -29,7 +45,7 @@ def tearDown(self): def testCat(self): """Test Cat""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Cat() # noqa: E501 + # model = Cat() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py index 136ed8da050a..a5bb91ac864e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.cat_all_of import CatAllOf class TestCatAllOf(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testCatAllOf(self): """Test CatAllOf""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.CatAllOf() # noqa: E501 + # model = CatAllOf() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_category.py b/samples/openapi3/client/petstore/python-experimental/test/test_category.py index c2ab96f823b6..59b64e5924a8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_category.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_category.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.category import Category class TestCategory(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testCategory(self): """Test Category""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Category() # noqa: E501 + # model = Category() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py index c42c3b583aae..34c085515a80 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import child_cat_all_of +except ImportError: + child_cat_all_of = sys.modules[ + 'petstore_api.model.child_cat_all_of'] +try: + from petstore_api.model import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.model.parent_pet'] +from petstore_api.model.child_cat import ChildCat class TestChildCat(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testChildCat(self): """Test ChildCat""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ChildCat() # noqa: E501 + # model = ChildCat() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py index 3304a81a2321..2a7aab100fbf 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.child_cat_all_of import ChildCatAllOf class TestChildCatAllOf(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testChildCatAllOf(self): """Test ChildCatAllOf""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ChildCatAllOf() # noqa: E501 + # model = ChildCatAllOf() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py index 3ac7e553042e..060df39e4b5e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.class_model import ClassModel class TestClassModel(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testClassModel(self): """Test ClassModel""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ClassModel() # noqa: E501 + # model = ClassModel() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_client.py b/samples/openapi3/client/petstore/python-experimental/test/test_client.py index 683190363445..ab5e3a80d377 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_client.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_client.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.client import Client class TestClient(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testClient(self): """Test Client""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Client() # noqa: E501 + # model = Client() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py index b1d4fc9079bd..0c0887509c8b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import quadrilateral_interface +except ImportError: + quadrilateral_interface = sys.modules[ + 'petstore_api.model.quadrilateral_interface'] +try: + from petstore_api.model import shape_interface +except ImportError: + shape_interface = sys.modules[ + 'petstore_api.model.shape_interface'] +from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral class TestComplexQuadrilateral(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testComplexQuadrilateral(self): """Test ComplexQuadrilateral""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ComplexQuadrilateral() # noqa: E501 + # model = ComplexQuadrilateral() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py b/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py index 0cbe8f8c102a..a82c352e84c1 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.danish_pig import DanishPig class TestDanishPig(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testDanishPig(self): """Test DanishPig""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.DanishPig() # noqa: E501 + # model = DanishPig() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py index 50e7c57bd0bf..5f4fb5230ac4 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py @@ -16,14 +16,13 @@ import petstore_api from petstore_api.api.default_api import DefaultApi # noqa: E501 -from petstore_api.rest import ApiException class TestDefaultApi(unittest.TestCase): """DefaultApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501 + self.api = DefaultApi() # noqa: E501 def tearDown(self): pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py index 37e9dd56d4ff..4a6fc61ad761 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +try: + from petstore_api.model import dog_all_of +except ImportError: + dog_all_of = sys.modules[ + 'petstore_api.model.dog_all_of'] +from petstore_api.model.dog import Dog class TestDog(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testDog(self): """Test Dog""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Dog() # noqa: E501 + # model = Dog() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py index 7f443eb9b60c..7ab4e8ae79d8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.dog_all_of import DogAllOf class TestDogAllOf(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testDogAllOf(self): """Test DogAllOf""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.DogAllOf() # noqa: E501 + # model = DogAllOf() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py index 6897ce82676d..dbfba3ea700f 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py @@ -11,17 +11,33 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import nullable_shape +except ImportError: + nullable_shape = sys.modules[ + 'petstore_api.model.nullable_shape'] +try: + from petstore_api.model import shape +except ImportError: + shape = sys.modules[ + 'petstore_api.model.shape'] +try: + from petstore_api.model import shape_or_null +except ImportError: + shape_or_null = sys.modules[ + 'petstore_api.model.shape_or_null'] +from petstore_api.model.drawing import Drawing class TestDrawing(unittest.TestCase): """Drawing unit test stubs""" def setUp(self): - self.api_client = petstore_api.ApiClient() + pass def tearDown(self): pass @@ -32,73 +48,79 @@ def test_create_instances(self): """ # Validate object can be created using pythonic names. - inst = petstore_api.Shape( + inst = shape.Shape( shape_type="Triangle", triangle_type="IsoscelesTriangle" ) - assert isinstance(inst, petstore_api.IsoscelesTriangle) + from petstore_api.model.isosceles_triangle import IsoscelesTriangle + assert isinstance(inst, IsoscelesTriangle) # Validate object can be created using OAS names. # For example, this can be used to construct objects on the client # when the input data is available as JSON documents. data = { - 'shapeType': "Triangle", - 'triangleType': "IsoscelesTriangle" + 'shapeType': "Triangle", + 'triangleType': "IsoscelesTriangle" } - inst = petstore_api.Shape(_spec_property_naming=True, **data) - assert isinstance(inst, petstore_api.IsoscelesTriangle) + inst = shape.Shape(_spec_property_naming=True, **data) + assert isinstance(inst, IsoscelesTriangle) def test_deserialize_oneof_reference(self): """ Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' schema is specified as a reference ($ref), not an inline 'oneOf' schema. """ - isosceles_triangle = petstore_api.Shape( + isosceles_triangle = shape.Shape( shape_type="Triangle", triangle_type="IsoscelesTriangle" ) - assert isinstance(isosceles_triangle, petstore_api.IsoscelesTriangle) - inst = petstore_api.Drawing( + from petstore_api.model.isosceles_triangle import IsoscelesTriangle + from petstore_api.model.triangle import Triangle + from petstore_api.model.equilateral_triangle import EquilateralTriangle + + assert isinstance(isosceles_triangle, IsoscelesTriangle) + inst = Drawing( # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] # composed schema. So we should be able to assign a petstore_api.Triangle # to a 'main_shape'. main_shape=isosceles_triangle, shapes=[ - petstore_api.Shape( + shape.Shape( shape_type="Triangle", triangle_type="EquilateralTriangle" ), - petstore_api.Triangle( + Triangle( shape_type="Triangle", triangle_type="IsoscelesTriangle" ), - petstore_api.EquilateralTriangle( + EquilateralTriangle( shape_type="Triangle", triangle_type="EquilateralTriangle" ), - petstore_api.Shape( + shape.Shape( shape_type="Quadrilateral", quadrilateral_type="ComplexQuadrilateral" ), ], ) - assert isinstance(inst, petstore_api.Drawing) - assert isinstance(inst.main_shape, petstore_api.IsoscelesTriangle) + from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral + assert isinstance(inst, Drawing) + assert isinstance(inst.main_shape, IsoscelesTriangle) self.assertEqual(len(inst.shapes), 4) - assert isinstance(inst.shapes[0], petstore_api.EquilateralTriangle) - assert isinstance(inst.shapes[1], petstore_api.IsoscelesTriangle) - assert isinstance(inst.shapes[2], petstore_api.EquilateralTriangle) - assert isinstance(inst.shapes[3], petstore_api.ComplexQuadrilateral) + assert isinstance(inst.shapes[0], EquilateralTriangle) + assert isinstance(inst.shapes[1], IsoscelesTriangle) + assert isinstance(inst.shapes[2], EquilateralTriangle) + assert isinstance(inst.shapes[3], ComplexQuadrilateral) # Validate we cannot assign the None value to main_shape because the 'null' type # is not one of the allowed types in the 'Shape' schema. err_msg = ("Invalid type for variable '{}'. " - "Required value type is {} and passed type was {} at {}") + "Required value type is {} and passed type was {} at {}") with self.assertRaisesRegexp( - petstore_api.ApiTypeError, - err_msg.format("main_shape", "Shape", "NoneType", "\['main_shape'\]") + petstore_api.ApiTypeError, + err_msg.format("main_shape", "Shape", "NoneType", "\['main_shape'\]") ): - inst = petstore_api.Drawing( + inst = Drawing( # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] # So the None value should not be allowed and an exception should be raised. main_shape=None, @@ -115,11 +137,11 @@ def test_deserialize_oneof_reference_with_null_type(self): # Validate we can assign the None value to shape_or_null, because the 'null' type # is one of the allowed types in the 'ShapeOrNull' schema. - inst = petstore_api.Drawing( + inst = Drawing( # 'shape_or_null' has type 'ShapeOrNull', which is a oneOf [null, triangle, quadrilateral] shape_or_null=None, ) - assert isinstance(inst, petstore_api.Drawing) + assert isinstance(inst, Drawing) self.assertFalse(hasattr(inst, 'main_shape')) self.assertTrue(hasattr(inst, 'shape_or_null')) self.assertIsNone(inst.shape_or_null) @@ -135,16 +157,15 @@ def test_deserialize_oneof_reference_with_nullable_type(self): # Validate we can assign the None value to nullable_shape, because the NullableShape # has the 'nullable: true' attribute. - inst = petstore_api.Drawing( + inst = Drawing( # 'nullable_shape' has type 'NullableShape', which is a oneOf [triangle, quadrilateral] - # and the 'nullable: true' attribute. + # and the 'nullable: true' attribute. nullable_shape=None, ) - assert isinstance(inst, petstore_api.Drawing) + assert isinstance(inst, Drawing) self.assertFalse(hasattr(inst, 'main_shape')) self.assertTrue(hasattr(inst, 'nullable_shape')) self.assertIsNone(inst.nullable_shape) - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py index 5f789287332a..143a23fe0d45 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.enum_arrays import EnumArrays class TestEnumArrays(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testEnumArrays(self): """Test EnumArrays""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.EnumArrays() # noqa: E501 + # model = EnumArrays() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py index f25e772ff26a..f910231c9d02 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.enum_class import EnumClass class TestEnumClass(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testEnumClass(self): """Test EnumClass""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.EnumClass() # noqa: E501 + # model = EnumClass() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py index 8238fb7a3ab9..6a98e49b9689 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py @@ -11,10 +11,31 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import outer_enum +except ImportError: + outer_enum = sys.modules[ + 'petstore_api.model.outer_enum'] +try: + from petstore_api.model import outer_enum_default_value +except ImportError: + outer_enum_default_value = sys.modules[ + 'petstore_api.model.outer_enum_default_value'] +try: + from petstore_api.model import outer_enum_integer +except ImportError: + outer_enum_integer = sys.modules[ + 'petstore_api.model.outer_enum_integer'] +try: + from petstore_api.model import outer_enum_integer_default_value +except ImportError: + outer_enum_integer_default_value = sys.modules[ + 'petstore_api.model.outer_enum_integer_default_value'] +from petstore_api.model.enum_test import EnumTest class TestEnumTest(unittest.TestCase): @@ -29,7 +50,7 @@ def tearDown(self): def testEnumTest(self): """Test EnumTest""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.EnumTest() # noqa: E501 + # model = EnumTest() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py index cdef216105eb..8f286edfdcba 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import shape_interface +except ImportError: + shape_interface = sys.modules[ + 'petstore_api.model.shape_interface'] +try: + from petstore_api.model import triangle_interface +except ImportError: + triangle_interface = sys.modules[ + 'petstore_api.model.triangle_interface'] +from petstore_api.model.equilateral_triangle import EquilateralTriangle class TestEquilateralTriangle(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testEquilateralTriangle(self): """Test EquilateralTriangle""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.EquilateralTriangle() # noqa: E501 + # model = EquilateralTriangle() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py index 581d1499eedf..f6678a59b240 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -16,14 +16,13 @@ import petstore_api from petstore_api.api.fake_api import FakeApi # noqa: E501 -from petstore_api.rest import ApiException class TestFakeApi(unittest.TestCase): """FakeApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 + self.api = FakeApi() # noqa: E501 def tearDown(self): pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py index f54e0d06644f..c12e35eb5dea 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -16,14 +16,13 @@ import petstore_api from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException class TestFakeClassnameTags123Api(unittest.TestCase): """FakeClassnameTags123Api unit test stubs""" def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + self.api = FakeClassnameTags123Api() # noqa: E501 def tearDown(self): pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file.py b/samples/openapi3/client/petstore/python-experimental/test/test_file.py index af185e32e6e8..8d60f64e01cc 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_file.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.file import File class TestFile(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testFile(self): """Test File""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.File() # noqa: E501 + # model = File() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py index c2de4e866cda..9a4f6d38dfef 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -11,10 +11,16 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import file +except ImportError: + file = sys.modules[ + 'petstore_api.model.file'] +from petstore_api.model.file_schema_test_class import FileSchemaTestClass class TestFileSchemaTestClass(unittest.TestCase): @@ -29,7 +35,7 @@ def tearDown(self): def testFileSchemaTestClass(self): """Test FileSchemaTestClass""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.FileSchemaTestClass() # noqa: E501 + # model = FileSchemaTestClass() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py index c54feb98c25a..8125de84ada3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.foo import Foo class TestFoo(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testFoo(self): """Test Foo""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Foo() # noqa: E501 + # model = Foo() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py index a9d39521e934..07f4f5e4c1f7 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.format_test import FormatTest class TestFormatTest(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testFormatTest(self): """Test FormatTest""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.FormatTest() # noqa: E501 + # model = FormatTest() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py index 1172373b9e1d..1eb9d09d5061 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import apple +except ImportError: + apple = sys.modules[ + 'petstore_api.model.apple'] +try: + from petstore_api.model import banana +except ImportError: + banana = sys.modules[ + 'petstore_api.model.banana'] +from petstore_api.model.fruit import Fruit class TestFruit(unittest.TestCase): @@ -33,7 +44,7 @@ def testFruit(self): # banana test length_cm = 20.3 color = 'yellow' - fruit = petstore_api.Fruit(length_cm=length_cm, color=color) + fruit = Fruit(length_cm=length_cm, color=color) # check its properties self.assertEqual(fruit.length_cm, length_cm) self.assertEqual(fruit['length_cm'], length_cm) @@ -79,7 +90,7 @@ def testFruit(self): # Per Python doc, if the named attribute does not exist, # default is returned if provided, otherwise AttributeError is raised. with self.assertRaises(AttributeError): - getattr(fruit, 'cultivar') + getattr(fruit, 'cultivar') # make sure that the ModelComposed class properties are correct # model._composed_schemas stores the anyOf/allOf/oneOf info @@ -89,15 +100,15 @@ def testFruit(self): 'anyOf': [], 'allOf': [], 'oneOf': [ - petstore_api.Apple, - petstore_api.Banana, + apple.Apple, + banana.Banana, ], } ) # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == petstore_api.Banana: + if composed_instance.__class__ == banana.Banana: banana_instance = composed_instance self.assertEqual( fruit._composed_instances, @@ -129,7 +140,7 @@ def testFruit(self): # including extra parameters raises an exception with self.assertRaises(petstore_api.ApiValueError): - fruit = petstore_api.Fruit( + fruit = Fruit( color=color, length_cm=length_cm, unknown_property='some value' @@ -137,7 +148,7 @@ def testFruit(self): # including input parameters for two oneOf instances raise an exception with self.assertRaises(petstore_api.ApiValueError): - fruit = petstore_api.Fruit( + fruit = Fruit( length_cm=length_cm, cultivar='granny smith' ) @@ -146,7 +157,7 @@ def testFruit(self): # apple test color = 'red' cultivar = 'golden delicious' - fruit = petstore_api.Fruit(color=color, cultivar=cultivar) + fruit = Fruit(color=color, cultivar=cultivar) # check its properties self.assertEqual(fruit.color, color) self.assertEqual(fruit['color'], color) @@ -166,7 +177,7 @@ def testFruit(self): # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == petstore_api.Apple: + if composed_instance.__class__ == apple.Apple: apple_instance = composed_instance self.assertEqual( fruit._composed_instances, @@ -191,20 +202,20 @@ def testFruit(self): def testFruitNullValue(self): # Since 'apple' is nullable, validate we can create an apple with the 'null' value. - apple = petstore_api.Apple(None) - self.assertIsNone(apple) + fruit = apple.Apple(None) + self.assertIsNone(fruit) # 'banana' is not nullable. with self.assertRaises(petstore_api.ApiTypeError): - banana = petstore_api.Banana(None) + banana.Banana(None) # Since 'fruit' has oneOf 'apple', 'banana' and 'apple' is nullable, # validate we can create a fruit with the 'null' value. - fruit = petstore_api.Fruit(None) + fruit = Fruit(None) self.assertIsNone(fruit) # Redo the same thing, this time passing a null Apple to the Fruit constructor. - fruit = petstore_api.Fruit(petstore_api.Apple(None)) + fruit = Fruit(apple.Apple(None)) self.assertIsNone(fruit) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py index f3e03faf271c..3a1aa8fc283b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import apple_req +except ImportError: + apple_req = sys.modules[ + 'petstore_api.model.apple_req'] +try: + from petstore_api.model import banana_req +except ImportError: + banana_req = sys.modules[ + 'petstore_api.model.banana_req'] +from petstore_api.model.fruit_req import FruitReq class TestFruitReq(unittest.TestCase): @@ -32,7 +43,7 @@ def testFruitReq(self): # make an instance of Fruit, a composed schema oneOf model # banana test length_cm = 20.3 - fruit = petstore_api.FruitReq(length_cm=length_cm) + fruit = FruitReq(length_cm=length_cm) # check its properties self.assertEqual(fruit.length_cm, length_cm) self.assertEqual(fruit['length_cm'], length_cm) @@ -70,8 +81,8 @@ def testFruitReq(self): 'anyOf': [], 'allOf': [], 'oneOf': [ - petstore_api.AppleReq, - petstore_api.BananaReq, + apple_req.AppleReq, + banana_req.BananaReq, type(None), ], } @@ -79,7 +90,7 @@ def testFruitReq(self): # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == petstore_api.BananaReq: + if composed_instance.__class__ == banana_req.BananaReq: banana_instance = composed_instance self.assertEqual( fruit._composed_instances, @@ -111,14 +122,14 @@ def testFruitReq(self): # including extra parameters raises an exception with self.assertRaises(petstore_api.ApiValueError): - fruit = petstore_api.FruitReq( + fruit = FruitReq( length_cm=length_cm, unknown_property='some value' ) # including input parameters for two oneOf instances raise an exception with self.assertRaises(petstore_api.ApiValueError): - fruit = petstore_api.FruitReq( + fruit = FruitReq( length_cm=length_cm, cultivar='granny smith' ) @@ -126,7 +137,7 @@ def testFruitReq(self): # make an instance of Fruit, a composed schema oneOf model # apple test cultivar = 'golden delicious' - fruit = petstore_api.FruitReq(cultivar=cultivar) + fruit = FruitReq(cultivar=cultivar) # check its properties self.assertEqual(fruit.cultivar, cultivar) self.assertEqual(fruit['cultivar'], cultivar) @@ -142,7 +153,7 @@ def testFruitReq(self): # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == petstore_api.AppleReq: + if composed_instance.__class__ == apple_req.AppleReq: apple_instance = composed_instance self.assertEqual( fruit._composed_instances, diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py index c68121f1fd8f..9d13e90659d0 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import apple +except ImportError: + apple = sys.modules[ + 'petstore_api.model.apple'] +try: + from petstore_api.model import banana +except ImportError: + banana = sys.modules[ + 'petstore_api.model.banana'] +from petstore_api.model.gm_fruit import GmFruit class TestGmFruit(unittest.TestCase): @@ -33,7 +44,7 @@ def testGmFruit(self): # banana test length_cm = 20.3 color = 'yellow' - fruit = petstore_api.GmFruit(length_cm=length_cm, color=color) + fruit = GmFruit(length_cm=length_cm, color=color) # check its properties self.assertEqual(fruit.length_cm, length_cm) self.assertEqual(fruit['length_cm'], length_cm) @@ -73,8 +84,8 @@ def testGmFruit(self): fruit._composed_schemas, { 'anyOf': [ - petstore_api.Apple, - petstore_api.Banana, + apple.Apple, + banana.Banana, ], 'allOf': [], 'oneOf': [], @@ -83,7 +94,7 @@ def testGmFruit(self): # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == petstore_api.Banana: + if composed_instance.__class__ == banana.Banana: banana_instance = composed_instance self.assertEqual( fruit._composed_instances, @@ -115,7 +126,7 @@ def testGmFruit(self): # including extra parameters raises an exception with self.assertRaises(petstore_api.ApiValueError): - fruit = petstore_api.GmFruit( + fruit = GmFruit( color=color, length_cm=length_cm, unknown_property='some value' @@ -124,7 +135,7 @@ def testGmFruit(self): # including input parameters for both anyOf instances works cultivar = 'banaple' color = 'orange' - fruit = petstore_api.GmFruit( + fruit = GmFruit( color=color, cultivar=cultivar, length_cm=length_cm @@ -142,9 +153,9 @@ def testGmFruit(self): # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == petstore_api.Apple: + if composed_instance.__class__ == apple.Apple: apple_instance = composed_instance - elif composed_instance.__class__ == petstore_api.Banana: + elif composed_instance.__class__ == banana.Banana: banana_instance = composed_instance self.assertEqual( fruit._composed_instances, @@ -167,7 +178,7 @@ def testGmFruit(self): color = 'red' cultivar = 'golden delicious' origin = 'California' - fruit = petstore_api.GmFruit(color=color, cultivar=cultivar, origin=origin) + fruit = GmFruit(color=color, cultivar=cultivar, origin=origin) # check its properties self.assertEqual(fruit.color, color) self.assertEqual(fruit['color'], color) @@ -193,7 +204,7 @@ def testGmFruit(self): # model._composed_instances is a list of the instances that were # made from the anyOf/allOf/OneOf classes in model._composed_schemas for composed_instance in fruit._composed_instances: - if composed_instance.__class__ == petstore_api.Apple: + if composed_instance.__class__ == apple.Apple: apple_instance = composed_instance self.assertEqual( fruit._composed_instances, diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py index dc0d300cdaea..286ef176575b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import child_cat +except ImportError: + child_cat = sys.modules[ + 'petstore_api.model.child_cat'] +try: + from petstore_api.model import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.model.parent_pet'] +from petstore_api.model.grandparent_animal import GrandparentAnimal class TestGrandparentAnimal(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testGrandparentAnimal(self): """Test GrandparentAnimal""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.GrandparentAnimal() # noqa: E501 + # model = GrandparentAnimal() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py index e042faf7c94c..9ebd7683b398 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.has_only_read_only import HasOnlyReadOnly class TestHasOnlyReadOnly(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testHasOnlyReadOnly(self): """Test HasOnlyReadOnly""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.HasOnlyReadOnly() # noqa: E501 + # model = HasOnlyReadOnly() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py index ebcc32f43964..11ff5f5cf636 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.health_check_result import HealthCheckResult class TestHealthCheckResult(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testHealthCheckResult(self): """Test HealthCheckResult""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.HealthCheckResult() # noqa: E501 + # model = HealthCheckResult() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py index fc2e177006a2..3b3eee80807c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.inline_object import InlineObject class TestInlineObject(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testInlineObject(self): """Test InlineObject""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.InlineObject() # noqa: E501 + # model = InlineObject() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py index 12a62225defd..77d4b46553dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.inline_object1 import InlineObject1 class TestInlineObject1(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testInlineObject1(self): """Test InlineObject1""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.InlineObject1() # noqa: E501 + # model = InlineObject1() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py index 1651197f964b..b2310f152179 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.inline_object2 import InlineObject2 class TestInlineObject2(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testInlineObject2(self): """Test InlineObject2""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.InlineObject2() # noqa: E501 + # model = InlineObject2() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py index 2efbae377dde..afe7ca434286 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.inline_object3 import InlineObject3 class TestInlineObject3(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testInlineObject3(self): """Test InlineObject3""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.InlineObject3() # noqa: E501 + # model = InlineObject3() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py index 4f74d9cacacf..1b9bea4716dc 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.inline_object4 import InlineObject4 class TestInlineObject4(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testInlineObject4(self): """Test InlineObject4""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.InlineObject4() # noqa: E501 + # model = InlineObject4() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py index 895cc44ea290..ac72c53c1e3c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.inline_object5 import InlineObject5 class TestInlineObject5(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testInlineObject5(self): """Test InlineObject5""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.InlineObject5() # noqa: E501 + # model = InlineObject5() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py index ecdd05f72fa4..b52167aea166 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py @@ -11,10 +11,16 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import foo +except ImportError: + foo = sys.modules[ + 'petstore_api.model.foo'] +from petstore_api.model.inline_response_default import InlineResponseDefault class TestInlineResponseDefault(unittest.TestCase): @@ -29,7 +35,7 @@ def tearDown(self): def testInlineResponseDefault(self): """Test InlineResponseDefault""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.InlineResponseDefault() # noqa: E501 + # model = InlineResponseDefault() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py index 1f27f751d061..d89ae6ab78dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import shape_interface +except ImportError: + shape_interface = sys.modules[ + 'petstore_api.model.shape_interface'] +try: + from petstore_api.model import triangle_interface +except ImportError: + triangle_interface = sys.modules[ + 'petstore_api.model.triangle_interface'] +from petstore_api.model.isosceles_triangle import IsoscelesTriangle class TestIsoscelesTriangle(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testIsoscelesTriangle(self): """Test IsoscelesTriangle""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.IsoscelesTriangle() # noqa: E501 + # model = IsoscelesTriangle() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_list.py b/samples/openapi3/client/petstore/python-experimental/test/test_list.py index 29979911a8e9..52156adfed2e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_list.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_list.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.list import List class TestList(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testList(self): """Test List""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.List() # noqa: E501 + # model = List() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py b/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py index cc783f53ed64..2a8893d02fb3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import whale +except ImportError: + whale = sys.modules[ + 'petstore_api.model.whale'] +try: + from petstore_api.model import zebra +except ImportError: + zebra = sys.modules[ + 'petstore_api.model.zebra'] +from petstore_api.model.mammal import Mammal class TestMammal(unittest.TestCase): @@ -30,8 +41,9 @@ def testMammal(self): """Test Mammal""" # tests that we can make a BasquePig by traveling through descendant discriminator in Pig - model = petstore_api.Mammal(class_name="BasquePig") - assert isinstance(model, petstore_api.BasquePig) + model = Mammal(class_name="BasquePig") + from petstore_api.model import basque_pig + assert isinstance(model, basque_pig.BasquePig) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py index 8592f21949bd..88b28ff93dac 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py @@ -11,10 +11,16 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import string_boolean_map +except ImportError: + string_boolean_map = sys.modules[ + 'petstore_api.model.string_boolean_map'] +from petstore_api.model.map_test import MapTest class TestMapTest(unittest.TestCase): @@ -29,7 +35,7 @@ def tearDown(self): def testMapTest(self): """Test MapTest""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.MapTest() # noqa: E501 + # model = MapTest() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py index a4e89d3e8c07..4dcb5ad4268c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -11,10 +11,16 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): @@ -29,7 +35,7 @@ def tearDown(self): def testMixedPropertiesAndAdditionalPropertiesClass(self): """Test MixedPropertiesAndAdditionalPropertiesClass""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 + # model = MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py index 149629fe1e8e..4012eaae3362 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.model200_response import Model200Response class TestModel200Response(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testModel200Response(self): """Test Model200Response""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Model200Response() # noqa: E501 + # model = Model200Response() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py index e48b2c479839..54c98b33cd66 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.model_return import ModelReturn class TestModelReturn(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testModelReturn(self): """Test ModelReturn""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ModelReturn() # noqa: E501 + # model = ModelReturn() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_name.py index 1f6407683b29..6a9be99d1a57 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_name.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_name.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.name import Name class TestName(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testName(self): """Test Name""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Name() # noqa: E501 + # model = Name() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py index 8af2cb8447ee..f73dc3d98bbb 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.nullable_class import NullableClass class TestNullableClass(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testNullableClass(self): """Test NullableClass""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.NullableClass() # noqa: E501 + # model = NullableClass() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py index 1e22479d4db4..d6bf001743bf 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import quadrilateral +except ImportError: + quadrilateral = sys.modules[ + 'petstore_api.model.quadrilateral'] +try: + from petstore_api.model import triangle +except ImportError: + triangle = sys.modules[ + 'petstore_api.model.triangle'] +from petstore_api.model.nullable_shape import NullableShape class TestNullableShape(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testNullableShape(self): """Test NullableShape""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.NullableShape() # noqa: E501 + # model = NullableShape() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py index 732baf4b84ed..07aab1d78af7 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.number_only import NumberOnly class TestNumberOnly(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testNumberOnly(self): """Test NumberOnly""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.NumberOnly() # noqa: E501 + # model = NumberOnly() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_order.py b/samples/openapi3/client/petstore/python-experimental/test/test_order.py index 10ce38e954ea..604c67042c34 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_order.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_order.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.order import Order class TestOrder(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testOrder(self): """Test Order""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Order() # noqa: E501 + # model = Order() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py index c191d04ec6b2..7da5c1f09b59 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.outer_composite import OuterComposite class TestOuterComposite(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testOuterComposite(self): """Test OuterComposite""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.OuterComposite() # noqa: E501 + # model = OuterComposite() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py index fbb8cb7ad5cf..ab9dac9d612b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.outer_enum import OuterEnum class TestOuterEnum(unittest.TestCase): @@ -30,15 +31,14 @@ def testOuterEnum(self): """Test OuterEnum""" # Since 'OuterEnum' is nullable, validate the null value can be assigned # to OuterEnum. - inst = petstore_api.OuterEnum(None) + inst = OuterEnum(None) self.assertIsNone(inst) - inst = petstore_api.OuterEnum('approved') - assert isinstance(inst, petstore_api.OuterEnum) + inst = OuterEnum('approved') + assert isinstance(inst, OuterEnum) with self.assertRaises(petstore_api.ApiValueError): - inst = petstore_api.OuterEnum('garbage') - assert isinstance(inst, petstore_api.OuterEnum) + OuterEnum('garbage') if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py index 80c9534a88e2..a0f6fb3cef51 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.outer_enum_default_value import OuterEnumDefaultValue class TestOuterEnumDefaultValue(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testOuterEnumDefaultValue(self): """Test OuterEnumDefaultValue""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.OuterEnumDefaultValue() # noqa: E501 + # model = OuterEnumDefaultValue() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py index 60724eefd711..9e0fa2975b4b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.outer_enum_integer import OuterEnumInteger class TestOuterEnumInteger(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testOuterEnumInteger(self): """Test OuterEnumInteger""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.OuterEnumInteger() # noqa: E501 + # model = OuterEnumInteger() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py index 8eca8fa69ac1..6eb78f95b0cf 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue class TestOuterEnumIntegerDefaultValue(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testOuterEnumIntegerDefaultValue(self): """Test OuterEnumIntegerDefaultValue""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.OuterEnumIntegerDefaultValue() # noqa: E501 + # model = OuterEnumIntegerDefaultValue() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py index 8db04124d66e..15262872e195 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import child_cat +except ImportError: + child_cat = sys.modules[ + 'petstore_api.model.child_cat'] +try: + from petstore_api.model import grandparent_animal +except ImportError: + grandparent_animal = sys.modules[ + 'petstore_api.model.grandparent_animal'] +from petstore_api.model.parent_pet import ParentPet class TestParentPet(unittest.TestCase): @@ -32,8 +43,9 @@ def testParentPet(self): # test that we can make a ParentPet from a ParentPet # which requires that we travel back through ParentPet's allOf descendant # GrandparentAnimal, and we use the descendant's discriminator to make ParentPet - model = petstore_api.ParentPet(pet_type="ParentPet") - assert isinstance(model, petstore_api.ParentPet) + model = ParentPet(pet_type="ParentPet") + assert isinstance(model, ParentPet) + if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py index db9e3729f505..fb8586e4090c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import category +except ImportError: + category = sys.modules[ + 'petstore_api.model.category'] +try: + from petstore_api.model import tag +except ImportError: + tag = sys.modules[ + 'petstore_api.model.tag'] +from petstore_api.model.pet import Pet class TestPet(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testPet(self): """Test Pet""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Pet() # noqa: E501 + # model = Pet() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py index 77665df879f1..3f2d3a8847ca 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py @@ -16,14 +16,13 @@ import petstore_api from petstore_api.api.pet_api import PetApi # noqa: E501 -from petstore_api.rest import ApiException class TestPetApi(unittest.TestCase): """PetApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 + self.api = PetApi() # noqa: E501 def tearDown(self): pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pig.py b/samples/openapi3/client/petstore/python-experimental/test/test_pig.py index afdd210da7d9..f98bed3f1910 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pig.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import basque_pig +except ImportError: + basque_pig = sys.modules[ + 'petstore_api.model.basque_pig'] +try: + from petstore_api.model import danish_pig +except ImportError: + danish_pig = sys.modules[ + 'petstore_api.model.danish_pig'] +from petstore_api.model.pig import Pig class TestPig(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testPig(self): """Test Pig""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Pig() # noqa: E501 + # model = Pig() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py index 9bb838811892..149b9a0070b6 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import complex_quadrilateral +except ImportError: + complex_quadrilateral = sys.modules[ + 'petstore_api.model.complex_quadrilateral'] +try: + from petstore_api.model import simple_quadrilateral +except ImportError: + simple_quadrilateral = sys.modules[ + 'petstore_api.model.simple_quadrilateral'] +from petstore_api.model.quadrilateral import Quadrilateral class TestQuadrilateral(unittest.TestCase): @@ -28,10 +39,10 @@ def tearDown(self): def testQuadrilateral(self): """Test Quadrilateral""" - complex_quadrilateral = petstore_api.Quadrilateral(shape_type="Quadrilateral", quadrilateral_type="ComplexQuadrilateral") - assert isinstance(complex_quadrilateral, petstore_api.ComplexQuadrilateral) - simple_quadrilateral = petstore_api.Quadrilateral(shape_type="Quadrilateral", quadrilateral_type="SimpleQuadrilateral") - assert isinstance(simple_quadrilateral, petstore_api.SimpleQuadrilateral) + instance = Quadrilateral(shape_type="Quadrilateral", quadrilateral_type="ComplexQuadrilateral") + assert isinstance(instance, complex_quadrilateral.ComplexQuadrilateral) + instance = Quadrilateral(shape_type="Quadrilateral", quadrilateral_type="SimpleQuadrilateral") + assert isinstance(instance, simple_quadrilateral.SimpleQuadrilateral) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py index 7a48ce64a9df..0b2e32dc37af 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.quadrilateral_interface import QuadrilateralInterface class TestQuadrilateralInterface(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testQuadrilateralInterface(self): """Test QuadrilateralInterface""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.QuadrilateralInterface() # noqa: E501 + # model = QuadrilateralInterface() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py index 553768f3303a..c2dcde240e77 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.read_only_first import ReadOnlyFirst class TestReadOnlyFirst(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testReadOnlyFirst(self): """Test ReadOnlyFirst""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ReadOnlyFirst() # noqa: E501 + # model = ReadOnlyFirst() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py index 8452fc183137..f5f1ccb3efa0 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import shape_interface +except ImportError: + shape_interface = sys.modules[ + 'petstore_api.model.shape_interface'] +try: + from petstore_api.model import triangle_interface +except ImportError: + triangle_interface = sys.modules[ + 'petstore_api.model.triangle_interface'] +from petstore_api.model.scalene_triangle import ScaleneTriangle class TestScaleneTriangle(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testScaleneTriangle(self): """Test ScaleneTriangle""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ScaleneTriangle() # noqa: E501 + # model = ScaleneTriangle() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape.py b/samples/openapi3/client/petstore/python-experimental/test/test_shape.py index e06fd0cb6faf..4424679aeccb 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import quadrilateral +except ImportError: + quadrilateral = sys.modules[ + 'petstore_api.model.quadrilateral'] +try: + from petstore_api.model import triangle +except ImportError: + triangle = sys.modules[ + 'petstore_api.model.triangle'] +from petstore_api.model.shape import Shape class TestShape(unittest.TestCase): @@ -28,67 +39,71 @@ def tearDown(self): def testShape(self): """Test Shape""" - equilateral_triangle = petstore_api.Triangle( + from petstore_api.model import complex_quadrilateral + from petstore_api.model import simple_quadrilateral + from petstore_api.model import equilateral_triangle + from petstore_api.model import isosceles_triangle + from petstore_api.model import scalene_triangle + tri = triangle.Triangle( shape_type="Triangle", triangle_type="EquilateralTriangle" ) - assert isinstance(equilateral_triangle, petstore_api.EquilateralTriangle) + assert isinstance(tri, equilateral_triangle.EquilateralTriangle) - isosceles_triangle = petstore_api.Triangle( + tri = triangle.Triangle( shape_type="Triangle", triangle_type="IsoscelesTriangle" ) - assert isinstance(isosceles_triangle, petstore_api.IsoscelesTriangle) + assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) - scalene_triangle = petstore_api.Triangle( + tri = triangle.Triangle( shape_type="Triangle", triangle_type="ScaleneTriangle" ) - assert isinstance(scalene_triangle, petstore_api.ScaleneTriangle) + assert isinstance(tri, scalene_triangle.ScaleneTriangle) - complex_quadrilateral = petstore_api.Shape( + quad = Shape( shape_type="Quadrilateral", quadrilateral_type="ComplexQuadrilateral" ) - assert isinstance(complex_quadrilateral, petstore_api.ComplexQuadrilateral) + assert isinstance(quad, complex_quadrilateral.ComplexQuadrilateral) - simple_quadrilateral = petstore_api.Shape( + quad = Shape( shape_type="Quadrilateral", quadrilateral_type="SimpleQuadrilateral" ) - assert isinstance(simple_quadrilateral, petstore_api.SimpleQuadrilateral) + assert isinstance(quad, simple_quadrilateral.SimpleQuadrilateral) # No discriminator provided. err_msg = ("Cannot deserialize input data due to missing discriminator. " - "The discriminator property '{}' is missing at path: ()" - ) + "The discriminator property '{}' is missing at path: ()" + ) with self.assertRaisesRegexp( - petstore_api.ApiValueError, - err_msg.format("shapeType") + petstore_api.ApiValueError, + err_msg.format("shapeType") ): - petstore_api.Shape() + Shape() # invalid shape_type (first discriminator). 'Circle' does not exist in the model. err_msg = ("Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '{}'='{}' at path: ()" - ) + "value. The OpenAPI document has no mapping for discriminator " + "property '{}'='{}' at path: ()" + ) with self.assertRaisesRegexp( - petstore_api.ApiValueError, - err_msg.format("shapeType", "Circle") + petstore_api.ApiValueError, + err_msg.format("shapeType", "Circle") ): - petstore_api.Shape(shape_type="Circle") + Shape(shape_type="Circle") # invalid quadrilateral_type (second discriminator) with self.assertRaisesRegexp( - petstore_api.ApiValueError, - err_msg.format("quadrilateralType", "Triangle") + petstore_api.ApiValueError, + err_msg.format("quadrilateralType", "Triangle") ): - petstore_api.Shape( + Shape( shape_type="Quadrilateral", quadrilateral_type="Triangle" ) - if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py index a768951489a0..c8b0270f9fc5 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.shape_interface import ShapeInterface class TestShapeInterface(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testShapeInterface(self): """Test ShapeInterface""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ShapeInterface() # noqa: E501 + # model = ShapeInterface() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py index b04d847204bc..e3bfa41e7e84 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import quadrilateral +except ImportError: + quadrilateral = sys.modules[ + 'petstore_api.model.quadrilateral'] +try: + from petstore_api.model import triangle +except ImportError: + triangle = sys.modules[ + 'petstore_api.model.triangle'] +from petstore_api.model.shape_or_null import ShapeOrNull class TestShapeOrNull(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testShapeOrNull(self): """Test ShapeOrNull""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.ShapeOrNull() # noqa: E501 + # model = ShapeOrNull() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py index f51722093445..b08ddf1c6781 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py @@ -11,10 +11,21 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import quadrilateral_interface +except ImportError: + quadrilateral_interface = sys.modules[ + 'petstore_api.model.quadrilateral_interface'] +try: + from petstore_api.model import shape_interface +except ImportError: + shape_interface = sys.modules[ + 'petstore_api.model.shape_interface'] +from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral class TestSimpleQuadrilateral(unittest.TestCase): @@ -29,7 +40,7 @@ def tearDown(self): def testSimpleQuadrilateral(self): """Test SimpleQuadrilateral""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.SimpleQuadrilateral() # noqa: E501 + # model = SimpleQuadrilateral() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py index 7de520d9cefe..6124525f5170 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.special_model_name import SpecialModelName class TestSpecialModelName(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testSpecialModelName(self): """Test SpecialModelName""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.SpecialModelName() # noqa: E501 + # model = SpecialModelName() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py index 81848d24a67e..0d9cc3dd36ea 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py @@ -16,14 +16,13 @@ import petstore_api from petstore_api.api.store_api import StoreApi # noqa: E501 -from petstore_api.rest import ApiException class TestStoreApi(unittest.TestCase): """StoreApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 + self.api = StoreApi() # noqa: E501 def tearDown(self): pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py index af071721eba3..e2e9d8b420b8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.string_boolean_map import StringBooleanMap class TestStringBooleanMap(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testStringBooleanMap(self): """Test StringBooleanMap""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.StringBooleanMap() # noqa: E501 + # model = StringBooleanMap() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py index 27c2be5391ab..b0a09d94a785 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py @@ -15,6 +15,7 @@ import unittest import petstore_api +from petstore_api.model.tag import Tag class TestTag(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testTag(self): """Test Tag""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Tag() # noqa: E501 + # model = Tag() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py index 42037a1ec79b..65ae20743e14 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py @@ -11,10 +11,26 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +try: + from petstore_api.model import equilateral_triangle +except ImportError: + equilateral_triangle = sys.modules[ + 'petstore_api.model.equilateral_triangle'] +try: + from petstore_api.model import isosceles_triangle +except ImportError: + isosceles_triangle = sys.modules[ + 'petstore_api.model.isosceles_triangle'] +try: + from petstore_api.model import scalene_triangle +except ImportError: + scalene_triangle = sys.modules[ + 'petstore_api.model.scalene_triangle'] +from petstore_api.model.triangle import Triangle class TestTriangle(unittest.TestCase): @@ -28,12 +44,12 @@ def tearDown(self): def testTriangle(self): """Test Triangle""" - equilateral_triangle = petstore_api.Triangle(shape_type="Triangle", triangle_type="EquilateralTriangle") - assert isinstance(equilateral_triangle, petstore_api.EquilateralTriangle) - isosceles_triangle = petstore_api.Triangle(shape_type="Triangle", triangle_type="IsoscelesTriangle") - assert isinstance(isosceles_triangle, petstore_api.IsoscelesTriangle) - scalene_triangle = petstore_api.Triangle(shape_type="Triangle", triangle_type="ScaleneTriangle") - assert isinstance(scalene_triangle, petstore_api.ScaleneTriangle) + tri = Triangle(shape_type="Triangle", triangle_type="EquilateralTriangle") + assert isinstance(tri, equilateral_triangle.EquilateralTriangle) + tri = Triangle(shape_type="Triangle", triangle_type="IsoscelesTriangle") + assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) + tri = Triangle(shape_type="Triangle", triangle_type="ScaleneTriangle") + assert isinstance(tri, scalene_triangle.ScaleneTriangle) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py index 4d87e647e61e..e087651a7d55 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.triangle_interface import TriangleInterface class TestTriangleInterface(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testTriangleInterface(self): """Test TriangleInterface""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.TriangleInterface() # noqa: E501 + # model = TriangleInterface() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user.py b/samples/openapi3/client/petstore/python-experimental/test/test_user.py index 3df641e29b6a..7241bb589c52 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_user.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.user import User class TestUser(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testUser(self): """Test User""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.User() # noqa: E501 + # model = User() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py index 6df730fba2b1..df306da07761 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py @@ -16,14 +16,13 @@ import petstore_api from petstore_api.api.user_api import UserApi # noqa: E501 -from petstore_api.rest import ApiException class TestUserApi(unittest.TestCase): """UserApi unit test stubs""" def setUp(self): - self.api = petstore_api.api.user_api.UserApi() # noqa: E501 + self.api = UserApi() # noqa: E501 def tearDown(self): pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_whale.py b/samples/openapi3/client/petstore/python-experimental/test/test_whale.py index 35d68f0cda02..3ad793af3e43 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_whale.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_whale.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.whale import Whale class TestWhale(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testWhale(self): """Test Whale""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Whale() # noqa: E501 + # model = Whale() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py b/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py index 6013bd9a9a20..fe3245cced48 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py @@ -11,10 +11,11 @@ from __future__ import absolute_import - +import sys import unittest import petstore_api +from petstore_api.model.zebra import Zebra class TestZebra(unittest.TestCase): @@ -29,7 +30,7 @@ def tearDown(self): def testZebra(self): """Test Zebra""" # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.Zebra() # noqa: E501 + # model = Zebra() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_api_validation.py b/samples/openapi3/client/petstore/python-experimental/tests/test_api_validation.py index a8a7276142bc..edf48ad0160b 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_api_validation.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_api_validation.py @@ -21,6 +21,7 @@ from collections import namedtuple import petstore_api +from petstore_api.model import format_test import petstore_api.configuration HOST = 'http://petstore.swagger.io/v2' @@ -50,7 +51,7 @@ def checkRaiseRegex(self, expected_exception, expected_regex): def test_multiple_of(self): - inst = petstore_api.FormatTest( + inst = format_test.FormatTest( byte='3', date=datetime.date(2000, 1, 1), password="abcdefghijkl", @@ -58,10 +59,10 @@ def test_multiple_of(self): number=65.0, float=62.4 ) - assert isinstance(inst, petstore_api.FormatTest) + assert isinstance(inst, format_test.FormatTest) with self.checkRaiseRegex(petstore_api.exceptions.ApiValueError, "Invalid value for `integer`, value must be a multiple of `2`"): - inst = petstore_api.FormatTest( + inst = format_test.FormatTest( byte='3', date=datetime.date(2000, 1, 1), password="abcdefghijkl", @@ -80,8 +81,8 @@ def test_multiple_of_deserialization(self): 'float': 62.4, } response = MockResponse(data=json.dumps(data)) - deserialized = self.api_client.deserialize(response, (petstore_api.FormatTest,), True) - self.assertTrue(isinstance(deserialized, petstore_api.FormatTest)) + deserialized = self.api_client.deserialize(response, (format_test.FormatTest,), True) + self.assertTrue(isinstance(deserialized, format_test.FormatTest)) with self.checkRaiseRegex(petstore_api.exceptions.ApiValueError, "Invalid value for `integer`, value must be a multiple of `2`"): data = { @@ -93,7 +94,7 @@ def test_multiple_of_deserialization(self): 'float': 62.4, } response = MockResponse(data=json.dumps(data)) - deserialized = self.api_client.deserialize(response, (petstore_api.FormatTest,), True) + deserialized = self.api_client.deserialize(response, (format_test.FormatTest,), True) # Disable JSON schema validation. No error should be raised during deserialization. config = petstore_api.Configuration() @@ -109,8 +110,8 @@ def test_multiple_of_deserialization(self): 'float': 62.4, } response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, (petstore_api.FormatTest,), True) - self.assertTrue(isinstance(deserialized, petstore_api.FormatTest)) + deserialized = api_client.deserialize(response, (format_test.FormatTest,), True) + self.assertTrue(isinstance(deserialized, format_test.FormatTest)) # Disable JSON schema validation but for a different keyword. # An error should be raised during deserialization. @@ -128,4 +129,4 @@ def test_multiple_of_deserialization(self): 'float': 62.4, } response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, (petstore_api.FormatTest,), True) + deserialized = api_client.deserialize(response, (format_test.FormatTest,), True) diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py b/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py index a34df3425672..23e597d9bf54 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py @@ -16,6 +16,20 @@ import datetime import petstore_api +from petstore_api.model import ( + shape, + equilateral_triangle, + animal, + dog, + apple, + mammal, + whale, + zebra, + banana, + fruit_req, + drawing, + banana_req, +) MockResponse = namedtuple('MockResponse', 'data') @@ -46,8 +60,8 @@ def test_deserialize_shape(self): } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.Shape,), True) - self.assertTrue(isinstance(deserialized, petstore_api.EquilateralTriangle)) + deserialized = self.deserialize(response, (shape.Shape,), True) + self.assertTrue(isinstance(deserialized, equilateral_triangle.EquilateralTriangle)) self.assertEqual(deserialized.shape_type, shape_type) self.assertEqual(deserialized.triangle_type, triangle_type) @@ -67,7 +81,7 @@ def test_deserialize_shape(self): petstore_api.ApiValueError, err_msg.format("quadrilateralType", "Triangle") ): - self.deserialize(response, (petstore_api.Shape,), True) + self.deserialize(response, (shape.Shape,), True) def test_deserialize_animal(self): """ @@ -86,8 +100,8 @@ def test_deserialize_animal(self): } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.Animal,), True) - self.assertTrue(isinstance(deserialized, petstore_api.Dog)) + deserialized = self.deserialize(response, (animal.Animal,), True) + self.assertTrue(isinstance(deserialized, dog.Dog)) self.assertEqual(deserialized.class_name, class_name) self.assertEqual(deserialized.color, color) self.assertEqual(deserialized.breed, breed) @@ -98,15 +112,15 @@ def test_regex_constraint(self): """ # Test with valid regex pattern. - inst = petstore_api.Apple( + inst = apple.Apple( cultivar="Akane" ) - assert isinstance(inst, petstore_api.Apple) + assert isinstance(inst, apple.Apple) - inst = petstore_api.Apple( + inst = apple.Apple( origin="cHiLe" ) - assert isinstance(inst, petstore_api.Apple) + assert isinstance(inst, apple.Apple) # Test with invalid regex pattern. err_msg = ("Invalid value for `{}`, must match regular expression `{}`$") @@ -114,7 +128,7 @@ def test_regex_constraint(self): petstore_api.ApiValueError, err_msg.format("cultivar", "[^`]*") ): - inst = petstore_api.Apple( + inst = apple.Apple( cultivar="!@#%@$#Akane" ) @@ -123,7 +137,7 @@ def test_regex_constraint(self): petstore_api.ApiValueError, err_msg.format("origin", "[^`]*") ): - inst = petstore_api.Apple( + inst = apple.Apple( origin="!@#%@$#Chile" ) @@ -143,8 +157,8 @@ def test_deserialize_mammal(self): 'className': class_name } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.Mammal,), True) - self.assertTrue(isinstance(deserialized, petstore_api.Whale)) + deserialized = self.deserialize(response, (mammal.Mammal,), True) + self.assertTrue(isinstance(deserialized, whale.Whale)) self.assertEqual(deserialized.has_baleen, has_baleen) self.assertEqual(deserialized.has_teeth, has_teeth) self.assertEqual(deserialized.class_name, class_name) @@ -157,8 +171,8 @@ def test_deserialize_mammal(self): 'className': class_name } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.Mammal,), True) - self.assertTrue(isinstance(deserialized, petstore_api.Zebra)) + deserialized = self.deserialize(response, (mammal.Mammal,), True) + self.assertTrue(isinstance(deserialized, zebra.Zebra)) self.assertEqual(deserialized.type, zebra_type) self.assertEqual(deserialized.class_name, class_name) @@ -170,8 +184,8 @@ def test_deserialize_float_value(self): 'lengthCm': 3.1415 } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.Banana,), True) - self.assertTrue(isinstance(deserialized, petstore_api.Banana)) + deserialized = self.deserialize(response, (banana.Banana,), True) + self.assertTrue(isinstance(deserialized, banana.Banana)) self.assertEqual(deserialized.length_cm, 3.1415) # Float value is serialized without decimal point @@ -179,8 +193,8 @@ def test_deserialize_float_value(self): 'lengthCm': 3 } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.Banana,), True) - self.assertTrue(isinstance(deserialized, petstore_api.Banana)) + deserialized = self.deserialize(response, (banana.Banana,), True) + self.assertTrue(isinstance(deserialized, banana.Banana)) self.assertEqual(deserialized.length_cm, 3.0) def test_deserialize_fruit_null_value(self): @@ -192,10 +206,10 @@ def test_deserialize_fruit_null_value(self): # Unmarshal 'null' value data = None response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.FruitReq, type(None)), True) + deserialized = self.deserialize(response, (fruit_req.FruitReq, type(None)), True) self.assertEqual(type(deserialized), type(None)) - inst = petstore_api.FruitReq(None) + inst = fruit_req.FruitReq(None) self.assertIsNone(inst) def test_deserialize_with_additional_properties(self): @@ -220,8 +234,8 @@ def test_deserialize_with_additional_properties(self): 'size': 'medium', } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.Dog,), True) - self.assertEqual(type(deserialized), petstore_api.Dog) + deserialized = self.deserialize(response, (dog.Dog,), True) + self.assertEqual(type(deserialized), dog.Dog) self.assertEqual(deserialized.class_name, 'Dog') self.assertEqual(deserialized.breed, 'golden retriever') @@ -238,8 +252,8 @@ def test_deserialize_with_additional_properties(self): 'p2': [ 'a', 'b', 123], } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.Mammal,), True) - self.assertEqual(type(deserialized), petstore_api.Zebra) + deserialized = self.deserialize(response, (mammal.Mammal,), True) + self.assertEqual(type(deserialized), zebra.Zebra) self.assertEqual(deserialized.class_name, 'zebra') self.assertEqual(deserialized.type, 'plains') self.assertEqual(deserialized.p1, True) @@ -259,8 +273,8 @@ def test_deserialize_with_additional_properties(self): 'unknown-group': 'abc', } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.BananaReq,), True) - self.assertEqual(type(deserialized), petstore_api.BananaReq) + deserialized = self.deserialize(response, (banana_req.BananaReq,), True) + self.assertEqual(type(deserialized), banana_req.BananaReq) self.assertEqual(deserialized.lengthCm, 21) self.assertEqual(deserialized.p1, True) @@ -286,4 +300,4 @@ def test_deserialize_with_additional_properties_and_reference(self): ], } response = MockResponse(data=json.dumps(data)) - deserialized = self.deserialize(response, (petstore_api.Drawing,), True) + deserialized = self.deserialize(response, (drawing.Drawing,), True) diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py index a85ae29c46e2..976a3da2df4f 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py @@ -12,18 +12,12 @@ """ from collections import namedtuple import json -import os import re -import shutil import unittest -from six.moves.urllib.parse import urlencode, urlparse import petstore_api +from petstore_api.model import cat, dog, isosceles_triangle, banana_req from petstore_api import Configuration, signing -from petstore_api.rest import ( - RESTClientObject, - RESTResponse -) from petstore_api.model_utils import ( file_type, @@ -57,7 +51,7 @@ def test_deserialize_banana_req_do_not_discard_unknown_properties(self): # Deserializing with strict validation raises an exception because the 'unknown_property' # is undeclared. with self.assertRaises(petstore_api.exceptions.ApiAttributeError) as cm: - deserialized = api_client.deserialize(response, ((petstore_api.BananaReq),), True) + deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) self.assertTrue(re.match("BananaReq has no attribute 'unknown_property' at.*", str(cm.exception)), 'Exception message: {0}'.format(str(cm.exception))) @@ -83,7 +77,7 @@ def test_deserialize_isosceles_triangle_do_not_discard_unknown_properties(self): # Deserializing with strict validation raises an exception because the 'unknown_property' # is undeclared. with self.assertRaises(petstore_api.ApiValueError) as cm: - deserialized = api_client.deserialize(response, ((petstore_api.IsoscelesTriangle),), True) + deserialized = api_client.deserialize(response, ((isosceles_triangle.IsoscelesTriangle),), True) self.assertTrue(re.match('.*Not all inputs were used.*unknown_property.*', str(cm.exception)), 'Exception message: {0}'.format(str(cm.exception))) @@ -107,8 +101,8 @@ def test_deserialize_banana_req_discard_unknown_properties(self): # The 'unknown_property' is undeclared, which would normally raise an exception, but # when discard_unknown_keys is set to True, the unknown properties are discarded. response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, ((petstore_api.BananaReq),), True) - self.assertTrue(isinstance(deserialized, petstore_api.BananaReq)) + deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) + self.assertTrue(isinstance(deserialized, banana_req.BananaReq)) # Check the 'unknown_property' and 'more-unknown' properties are not present in the # output. self.assertIn("length_cm", deserialized.to_dict().keys()) @@ -133,8 +127,8 @@ def test_deserialize_cat_do_not_discard_unknown_properties(self): # Deserializing with strict validation does not raise an exception because the even though # the 'dynamic-property' is undeclared, the 'Cat' schema defines the additionalProperties # attribute. - deserialized = api_client.deserialize(response, ((petstore_api.Cat),), True) - self.assertTrue(isinstance(deserialized, petstore_api.Cat)) + deserialized = api_client.deserialize(response, ((cat.Cat),), True) + self.assertTrue(isinstance(deserialized, cat.Cat)) self.assertIn('color', deserialized.to_dict()) self.assertEqual(deserialized['color'], 'black') @@ -156,8 +150,8 @@ def test_deserialize_cat_discard_unknown_properties(self): # The 'my_additional_property' is undeclared, but 'Cat' has a 'Address' type through # the allOf: [ $ref: '#/components/schemas/Address' ]. response = MockResponse(data=json.dumps(data)) - deserialized = api_client.deserialize(response, ((petstore_api.Cat),), True) - self.assertTrue(isinstance(deserialized, petstore_api.Cat)) + deserialized = api_client.deserialize(response, ((cat.Cat),), True) + self.assertTrue(isinstance(deserialized, cat.Cat)) # Check the 'unknown_property' and 'more-unknown' properties are not present in the # output. self.assertIn("declawed", deserialized.to_dict().keys()) diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index 9864cf1a2139..e8f0dd186a98 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -25,6 +25,8 @@ from six.moves.urllib.parse import urlencode, urlparse import petstore_api +from petstore_api.model import category, tag, pet +from petstore_api.api.pet_api import PetApi from petstore_api import Configuration, signing from petstore_api.rest import ( RESTClientObject, @@ -211,13 +213,13 @@ def tearDownClass(cls): @classmethod def setUpModels(cls): - cls.category = petstore_api.Category() + cls.category = category.Category() cls.category.id = id_gen() cls.category.name = "dog" - cls.tag = petstore_api.Tag() + cls.tag = tag.Tag() cls.tag.id = id_gen() cls.tag.name = "python-pet-tag" - cls.pet = petstore_api.Pet( + cls.pet = pet.Pet( name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"] ) @@ -286,7 +288,7 @@ def test_valid_http_signature(self): config.access_token = None api_client = petstore_api.ApiClient(config) - pet_api = petstore_api.PetApi(api_client) + pet_api = PetApi(api_client) mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool @@ -317,7 +319,7 @@ def test_valid_http_signature_with_defaults(self): config.access_token = None api_client = petstore_api.ApiClient(config) - pet_api = petstore_api.PetApi(api_client) + pet_api = PetApi(api_client) mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool @@ -353,7 +355,7 @@ def test_valid_http_signature_rsassa_pkcs1v15(self): config.access_token = None api_client = petstore_api.ApiClient(config) - pet_api = petstore_api.PetApi(api_client) + pet_api = PetApi(api_client) mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool @@ -389,7 +391,7 @@ def test_valid_http_signature_rsassa_pss(self): config.access_token = None api_client = petstore_api.ApiClient(config) - pet_api = petstore_api.PetApi(api_client) + pet_api = PetApi(api_client) mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool @@ -425,7 +427,7 @@ def test_valid_http_signature_ec_p521(self): config.access_token = None api_client = petstore_api.ApiClient(config) - pet_api = petstore_api.PetApi(api_client) + pet_api = PetApi(api_client) mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool From 3ddc78393cf936076778783a956db613b3a07812 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 1 Jun 2020 15:36:18 +0800 Subject: [PATCH 10/12] Minor enhancement to Python client generator's code format (#6510) * minor enhancement to python java class code format * minor format python experimental --- .../languages/PythonClientCodegen.java | 120 ++++++++++-------- .../PythonClientExperimentalCodegen.java | 68 +++++----- .../python/PythonClientCodegenTest.java | 9 +- .../python/PythonClientExperimentalTest.java | 2 +- 4 files changed, 100 insertions(+), 99 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 03c285890254..612e7dc8f86d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -711,7 +711,7 @@ public String toExampleValue(Schema schema) { private String toExampleValueRecursive(Schema schema, List included_schemas, int indentation) { String indentation_string = ""; - for (int i=0 ; i< indentation ; i++) indentation_string += " "; + for (int i = 0; i < indentation; i++) indentation_string += " "; String example = super.toExampleValue(schema); if (ModelUtils.isNullType(schema) && null != example) { @@ -720,9 +720,11 @@ private String toExampleValueRecursive(Schema schema, List included_sche return "None"; } // correct "true"s into "True"s, since super.toExampleValue uses "toString()" on Java booleans - if (ModelUtils.isBooleanSchema(schema) && null!=example) { - if ("false".equalsIgnoreCase(example)) example = "False"; - else example = "True"; + if (ModelUtils.isBooleanSchema(schema) && null != example) { + if ("false".equalsIgnoreCase(example)) + example = "False"; + else + example = "True"; } // correct "'"s into "'"s after toString() @@ -739,7 +741,7 @@ private String toExampleValueRecursive(Schema schema, List included_sche } if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { - // Enum case: + // Enum case: example = schema.getEnum().get(0).toString(); if (ModelUtils.isStringSchema(schema)) { example = "'" + escapeText(example) + "'"; @@ -749,7 +751,7 @@ private String toExampleValueRecursive(Schema schema, List included_sche return example; } else if (null != schema.get$ref()) { - // $ref case: + // $ref case: Map allDefinitions = ModelUtils.getSchemas(this.openAPI); String ref = ModelUtils.getSimpleRef(schema.get$ref()); if (allDefinitions != null) { @@ -783,13 +785,22 @@ private String toExampleValueRecursive(Schema schema, List included_sche example = "YQ=="; } else if (ModelUtils.isStringSchema(schema)) { // a BigDecimal: - if ("Number".equalsIgnoreCase(schema.getFormat())) {return "1";} - if (StringUtils.isNotBlank(schema.getPattern())) return "'a'"; // I cheat here, since it would be too complicated to generate a string from a regexp + if ("Number".equalsIgnoreCase(schema.getFormat())) { + return "1"; + } + if (StringUtils.isNotBlank(schema.getPattern())) + return "'a'"; // I cheat here, since it would be too complicated to generate a string from a regexp + int len = 0; - if (null != schema.getMinLength()) len = schema.getMinLength().intValue(); - if (len < 1) len = 1; + + if (null != schema.getMinLength()) + len = schema.getMinLength().intValue(); + + if (len < 1) + len = 1; + example = ""; - for (int i=0;i included_sche included_schemas.add(schema.getTitle()); } ArraySchema arrayschema = (ArraySchema) schema; - example = "[\n" + indentation_string + toExampleValueRecursive(arrayschema.getItems(), included_schemas, indentation+1) + "\n" + indentation_string + "]"; + example = "[\n" + indentation_string + toExampleValueRecursive(arrayschema.getItems(), included_schemas, indentation + 1) + "\n" + indentation_string + "]"; } else if (ModelUtils.isMapSchema(schema)) { if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { included_schemas.add(schema.getTitle()); @@ -822,7 +833,7 @@ private String toExampleValueRecursive(Schema schema, List included_sche the_key = "'" + escapeText(the_key) + "'"; } } - example = "{\n" + indentation_string + the_key + " : " + toExampleValueRecursive(additional, included_schemas, indentation+1) + "\n" + indentation_string + "}"; + example = "{\n" + indentation_string + the_key + " : " + toExampleValueRecursive(additional, included_schemas, indentation + 1) + "\n" + indentation_string + "}"; } else { example = "{ }"; } @@ -834,11 +845,11 @@ private String toExampleValueRecursive(Schema schema, List included_sche // I remove any property that is a discriminator, since it is not well supported by the python generator String toExclude = null; - if (schema.getDiscriminator()!=null) { + if (schema.getDiscriminator() != null) { toExclude = schema.getDiscriminator().getPropertyName(); } - example = packageName + ".models." + underscore(schema.getTitle())+"."+schema.getTitle()+"("; + example = packageName + ".models." + underscore(schema.getTitle()) + "." + schema.getTitle() + "("; // if required only: // List reqs = schema.getRequired(); @@ -852,7 +863,8 @@ private String toExampleValueRecursive(Schema schema, List included_sche Map properties = schema.getProperties(); Set propkeys = null; - if (properties != null) propkeys = properties.keySet(); + if (properties != null) + propkeys = properties.keySet(); if (toExclude != null && reqs.contains(toExclude)) { reqs.remove(toExclude); } @@ -879,7 +891,7 @@ private String toExampleValueRecursive(Schema schema, List included_sche } } } - example +=")"; + example += ")"; } else { LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue"); } @@ -908,44 +920,44 @@ public void setParameterExampleValue(CodegenParameter p) { } if (type != null) { - if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) { - if (example == null) { - example = p.paramName + "_example"; - } - example = "'" + escapeText(example) + "'"; - } else if ("Integer".equals(type) || "int".equals(type)) { - if (example == null) { - example = "56"; - } - } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) { - if (example == null) { - example = "3.4"; - } - } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) { - if (example == null) { - example = "True"; - } - } else if ("file".equalsIgnoreCase(type)) { - if (example == null) { - example = "/path/to/file"; - } - example = "'" + escapeText(example) + "'"; - } else if ("Date".equalsIgnoreCase(type)) { - if (example == null) { - example = "2013-10-20"; - } - example = "'" + escapeText(example) + "'"; - } else if ("DateTime".equalsIgnoreCase(type)) { - if (example == null) { - example = "2013-10-20T19:20:30+01:00"; + if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) { + if (example == null) { + example = p.paramName + "_example"; + } + example = "'" + escapeText(example) + "'"; + } else if ("Integer".equals(type) || "int".equals(type)) { + if (example == null) { + example = "56"; + } + } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) { + if (example == null) { + example = "3.4"; + } + } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) { + if (example == null) { + example = "True"; + } + } else if ("file".equalsIgnoreCase(type)) { + if (example == null) { + example = "/path/to/file"; + } + example = "'" + escapeText(example) + "'"; + } else if ("Date".equalsIgnoreCase(type)) { + if (example == null) { + example = "2013-10-20"; + } + example = "'" + escapeText(example) + "'"; + } else if ("DateTime".equalsIgnoreCase(type)) { + if (example == null) { + example = "2013-10-20T19:20:30+01:00"; + } + example = "'" + escapeText(example) + "'"; + } else if (!languageSpecificPrimitives.contains(type)) { + // type is a model class, e.g. User + example = this.packageName + "." + type + "()"; + } else { + LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue"); } - example = "'" + escapeText(example) + "'"; - } else if (!languageSpecificPrimitives.contains(type)) { - // type is a model class, e.g. User - example = this.packageName + "." + type + "()"; - } else { - LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue"); - } } if (example == null) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 384960012385..8fff23a7af31 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -17,30 +17,24 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.examples.Example; import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.MediaType; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.security.SecurityScheme; -import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.examples.ExampleGenerator; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ProcessUtils; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.io.File; import java.util.*; import java.util.regex.Pattern; @@ -83,7 +77,7 @@ public PythonClientExperimentalCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - ); + ); // this may set datatype right for additional properties instantiationTypes.put("map", "dict"); @@ -145,7 +139,7 @@ public void processOpts() { // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. Map securitySchemeMap = openAPI != null ? - (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; + (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; List authMethods = fromSecurity(securitySchemeMap); if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { supportingFiles.add(new SupportingFile("python-experimental/signing.mustache", packagePath(), "signing.py")); @@ -172,12 +166,12 @@ public void processOpts() { supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); if (!generateSourceCodeOnly) { - supportingFiles.remove(new SupportingFile("setup.mustache", "", "setup.py")); - supportingFiles.add(new SupportingFile("python-experimental/setup.mustache", "", "setup.py")); - supportingFiles.remove(new SupportingFile("requirements.mustache", "", "requirements.txt")); - supportingFiles.add(new SupportingFile("python-experimental/requirements.mustache", "", "requirements.txt")); - supportingFiles.remove(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); - supportingFiles.add(new SupportingFile("python-experimental/test-requirements.mustache", "", "test-requirements.txt")); + supportingFiles.remove(new SupportingFile("setup.mustache", "", "setup.py")); + supportingFiles.add(new SupportingFile("python-experimental/setup.mustache", "", "setup.py")); + supportingFiles.remove(new SupportingFile("requirements.mustache", "", "requirements.txt")); + supportingFiles.add(new SupportingFile("python-experimental/requirements.mustache", "", "requirements.txt")); + supportingFiles.remove(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); + supportingFiles.add(new SupportingFile("python-experimental/test-requirements.mustache", "", "test-requirements.txt")); } // default this to true so the python ModelSimple models will be generated @@ -305,7 +299,7 @@ public String toModelImport(String name) { // name looks like cat.Cat String moduleName = name.split("\\.")[0]; // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html - return "from " + modelPackage() + " import "+ moduleName; + return "from " + modelPackage() + " import " + moduleName; } private String robustImport(String name) { @@ -313,8 +307,8 @@ private String robustImport(String name) { String moduleName = name.split("\\.")[0]; // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html String modelImport = "try:\n from " + modelPackage() + - " import " + moduleName+ "\nexcept ImportError:\n " + - moduleName + " = sys.modules[\n '" + modelPackage() + "." + moduleName + "']"; + " import " + moduleName + "\nexcept ImportError:\n " + + moduleName + " = sys.modules[\n '" + modelPackage() + "." + moduleName + "']"; return modelImport; } @@ -346,9 +340,9 @@ private void fixOperationImports(Set imports) { @Override @SuppressWarnings("static-method") public Map postProcessOperationsWithModels(Map objs, List allModels) { - HashMap val = (HashMap)objs.get("operations"); + HashMap val = (HashMap) objs.get("operations"); ArrayList operations = (ArrayList) val.get("operation"); - ArrayList> imports = (ArrayList>)objs.get("imports"); + ArrayList> imports = (ArrayList>) objs.get("imports"); imports.clear(); for (CodegenOperation operation : operations) { fixOperationImports(operation.imports); @@ -377,7 +371,7 @@ private void fixModelImports(Set imports) { /** * Override with special post-processing for all models. - */ + */ @SuppressWarnings({"static-method", "unchecked"}) public Map postProcessAllModels(Map objs) { // loop through all models and delete ones where type!=object and the model has no validations and enums @@ -720,7 +714,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty p) { public void postProcessParameter(CodegenParameter p) { postProcessPattern(p.pattern, p.vendorExtensions); // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives - if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)){ + if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)) { p.baseType = null; } else if (p.isListContainer && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { // fix ListContainers @@ -728,7 +722,7 @@ public void postProcessParameter(CodegenParameter p) { } } - private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel result){ + private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel result) { // for composed schema models, if the required properties are only from oneOf or anyOf models // give them a nulltype.Null so the user can omit including them in python ComposedSchema cs = (ComposedSchema) schema; @@ -750,7 +744,7 @@ private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel resu if (anyOf != null) { oneOfanyOfSchemas.addAll(anyOf); } - for (Schema sc: oneOfanyOfSchemas) { + for (Schema sc : oneOfanyOfSchemas) { Schema refSchema = ModelUtils.getReferencedSchema(this.openAPI, sc); addProperties(otherProperties, otherRequired, refSchema); } @@ -768,7 +762,7 @@ private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel resu List reqVars = result.getRequiredVars(); if (reqVars != null) { - for (CodegenProperty cp: reqVars) { + for (CodegenProperty cp : reqVars) { String propName = cp.baseName; if (otherRequiredSet.contains(propName) && !selfRequiredSet.contains(propName)) { // if var is in otherRequiredSet and is not in selfRequiredSet and is in result.requiredVars @@ -905,20 +899,20 @@ public String getSimpleTypeDeclaration(Schema schema) { * Primitive types in the OAS specification are implemented in Python using the corresponding * Python primitive types. * Composed types (e.g. allAll, oneOf, anyOf) are represented in Python using list of types. - * + *

* The caller should set the prefix and suffix arguments to empty string, except when * getTypeString invokes itself recursively. A non-empty prefix/suffix may be specified * to wrap the return value in a python dict, list or tuple. - * + *

* Examples: * - "bool, date, float" The data must be a bool, date or float. * - "[bool, date]" The data must be an array, and the array items must be a bool or date. - * - * @param p The OAS schema. - * @param prefix prepended to the returned value. - * @param suffix appended to the returned value. + * + * @param p The OAS schema. + * @param prefix prepended to the returned value. + * @param suffix appended to the returned value. * @param referencedModelNames a list of models that are being referenced while generating the types, - * may be used to generate imports. + * may be used to generate imports. * @return a comma-separated string representation of the Python types */ private String getTypeString(Schema p, String prefix, String suffix, List referencedModelNames) { @@ -968,7 +962,7 @@ private String getTypeString(Schema p, String prefix, String suffix, List Date: Mon, 1 Jun 2020 20:01:06 +0800 Subject: [PATCH 11/12] Undo PR #6451 (#6514) * Revert "Minor enhancement to Python client generator's code format (#6510)" This reverts commit 3ddc78393cf936076778783a956db613b3a07812. * Revert "[Python][Client] Fix delimiter collision issue #5981 (#6451)" This reverts commit 6783b90fe230360c58b360817887f418475b745b. --- .../languages/PythonClientCodegen.java | 129 ++++++++---------- .../PythonClientExperimentalCodegen.java | 68 ++++----- .../python/PythonClientCodegenTest.java | 100 +------------- .../python/PythonClientExperimentalTest.java | 2 +- 4 files changed, 99 insertions(+), 200 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 612e7dc8f86d..5c0df0ab8178 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -683,12 +683,8 @@ public String toDefaultValue(Schema p) { if (p.getDefault() != null) { if (Pattern.compile("\r\n|\r|\n").matcher((String) p.getDefault()).find()) return "'''" + p.getDefault() + "'''"; - else if (p.getEnum() == null) - // wrap using double quotes to avoid the need to escape any embedded single quotes - return "\"" + p.getDefault() + "\""; else - // convert to enum var name later in postProcessModels - return (String) p.getDefault(); + return "'" + ((String) p.getDefault()).replaceAll("'", "\'") + "'"; } } else if (ModelUtils.isArraySchema(p)) { if (p.getDefault() != null) { @@ -711,7 +707,7 @@ public String toExampleValue(Schema schema) { private String toExampleValueRecursive(Schema schema, List included_schemas, int indentation) { String indentation_string = ""; - for (int i = 0; i < indentation; i++) indentation_string += " "; + for (int i=0 ; i< indentation ; i++) indentation_string += " "; String example = super.toExampleValue(schema); if (ModelUtils.isNullType(schema) && null != example) { @@ -720,11 +716,9 @@ private String toExampleValueRecursive(Schema schema, List included_sche return "None"; } // correct "true"s into "True"s, since super.toExampleValue uses "toString()" on Java booleans - if (ModelUtils.isBooleanSchema(schema) && null != example) { - if ("false".equalsIgnoreCase(example)) - example = "False"; - else - example = "True"; + if (ModelUtils.isBooleanSchema(schema) && null!=example) { + if ("false".equalsIgnoreCase(example)) example = "False"; + else example = "True"; } // correct "'"s into "'"s after toString() @@ -734,14 +728,13 @@ private String toExampleValueRecursive(Schema schema, List included_sche if (StringUtils.isNotBlank(example) && !"null".equals(example)) { if (ModelUtils.isStringSchema(schema)) { - // wrap using double quotes to avoid the need to escape any embedded single quotes - example = "\"" + example + "\""; + example = "'" + example + "'"; } return example; } if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { - // Enum case: + // Enum case: example = schema.getEnum().get(0).toString(); if (ModelUtils.isStringSchema(schema)) { example = "'" + escapeText(example) + "'"; @@ -751,7 +744,7 @@ private String toExampleValueRecursive(Schema schema, List included_sche return example; } else if (null != schema.get$ref()) { - // $ref case: + // $ref case: Map allDefinitions = ModelUtils.getSchemas(this.openAPI); String ref = ModelUtils.getSimpleRef(schema.get$ref()); if (allDefinitions != null) { @@ -785,22 +778,13 @@ private String toExampleValueRecursive(Schema schema, List included_sche example = "YQ=="; } else if (ModelUtils.isStringSchema(schema)) { // a BigDecimal: - if ("Number".equalsIgnoreCase(schema.getFormat())) { - return "1"; - } - if (StringUtils.isNotBlank(schema.getPattern())) - return "'a'"; // I cheat here, since it would be too complicated to generate a string from a regexp - + if ("Number".equalsIgnoreCase(schema.getFormat())) {return "1";} + if (StringUtils.isNotBlank(schema.getPattern())) return "'a'"; // I cheat here, since it would be too complicated to generate a string from a regexp int len = 0; - - if (null != schema.getMinLength()) - len = schema.getMinLength().intValue(); - - if (len < 1) - len = 1; - + if (null != schema.getMinLength()) len = schema.getMinLength().intValue(); + if (len < 1) len = 1; example = ""; - for (int i = 0; i < len; i++) example += i; + for (int i=0;i included_sche included_schemas.add(schema.getTitle()); } ArraySchema arrayschema = (ArraySchema) schema; - example = "[\n" + indentation_string + toExampleValueRecursive(arrayschema.getItems(), included_schemas, indentation + 1) + "\n" + indentation_string + "]"; + example = "[\n" + indentation_string + toExampleValueRecursive(arrayschema.getItems(), included_schemas, indentation+1) + "\n" + indentation_string + "]"; } else if (ModelUtils.isMapSchema(schema)) { if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { included_schemas.add(schema.getTitle()); @@ -833,7 +817,7 @@ private String toExampleValueRecursive(Schema schema, List included_sche the_key = "'" + escapeText(the_key) + "'"; } } - example = "{\n" + indentation_string + the_key + " : " + toExampleValueRecursive(additional, included_schemas, indentation + 1) + "\n" + indentation_string + "}"; + example = "{\n" + indentation_string + the_key + " : " + toExampleValueRecursive(additional, included_schemas, indentation+1) + "\n" + indentation_string + "}"; } else { example = "{ }"; } @@ -845,11 +829,11 @@ private String toExampleValueRecursive(Schema schema, List included_sche // I remove any property that is a discriminator, since it is not well supported by the python generator String toExclude = null; - if (schema.getDiscriminator() != null) { + if (schema.getDiscriminator()!=null) { toExclude = schema.getDiscriminator().getPropertyName(); } - example = packageName + ".models." + underscore(schema.getTitle()) + "." + schema.getTitle() + "("; + example = packageName + ".models." + underscore(schema.getTitle())+"."+schema.getTitle()+"("; // if required only: // List reqs = schema.getRequired(); @@ -863,8 +847,7 @@ private String toExampleValueRecursive(Schema schema, List included_sche Map properties = schema.getProperties(); Set propkeys = null; - if (properties != null) - propkeys = properties.keySet(); + if (properties != null) propkeys = properties.keySet(); if (toExclude != null && reqs.contains(toExclude)) { reqs.remove(toExclude); } @@ -891,7 +874,7 @@ private String toExampleValueRecursive(Schema schema, List included_sche } } } - example += ")"; + example +=")"; } else { LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue"); } @@ -919,45 +902,43 @@ public void setParameterExampleValue(CodegenParameter p) { type = p.dataType; } - if (type != null) { - if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) { - if (example == null) { - example = p.paramName + "_example"; - } - example = "'" + escapeText(example) + "'"; - } else if ("Integer".equals(type) || "int".equals(type)) { - if (example == null) { - example = "56"; - } - } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) { - if (example == null) { - example = "3.4"; - } - } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) { - if (example == null) { - example = "True"; - } - } else if ("file".equalsIgnoreCase(type)) { - if (example == null) { - example = "/path/to/file"; - } - example = "'" + escapeText(example) + "'"; - } else if ("Date".equalsIgnoreCase(type)) { - if (example == null) { - example = "2013-10-20"; - } - example = "'" + escapeText(example) + "'"; - } else if ("DateTime".equalsIgnoreCase(type)) { - if (example == null) { - example = "2013-10-20T19:20:30+01:00"; - } - example = "'" + escapeText(example) + "'"; - } else if (!languageSpecificPrimitives.contains(type)) { - // type is a model class, e.g. User - example = this.packageName + "." + type + "()"; - } else { - LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue"); + if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) { + if (example == null) { + example = p.paramName + "_example"; + } + example = "'" + escapeText(example) + "'"; + } else if ("Integer".equals(type) || "int".equals(type)) { + if (example == null) { + example = "56"; + } + } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) { + if (example == null) { + example = "3.4"; + } + } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) { + if (example == null) { + example = "True"; + } + } else if ("file".equalsIgnoreCase(type)) { + if (example == null) { + example = "/path/to/file"; + } + example = "'" + escapeText(example) + "'"; + } else if ("Date".equalsIgnoreCase(type)) { + if (example == null) { + example = "2013-10-20"; } + example = "'" + escapeText(example) + "'"; + } else if ("DateTime".equalsIgnoreCase(type)) { + if (example == null) { + example = "2013-10-20T19:20:30+01:00"; + } + example = "'" + escapeText(example) + "'"; + } else if (!languageSpecificPrimitives.contains(type)) { + // type is a model class, e.g. User + example = this.packageName + "." + type + "()"; + } else { + LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue"); } if (example == null) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 8fff23a7af31..384960012385 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -17,24 +17,30 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.examples.Example; import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.MediaType; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.security.SecurityScheme; +import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.examples.ExampleGenerator; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ProcessUtils; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.io.File; import java.util.*; import java.util.regex.Pattern; @@ -77,7 +83,7 @@ public PythonClientExperimentalCodegen() { .excludeParameterFeatures( ParameterFeature.Cookie ) - ); + ); // this may set datatype right for additional properties instantiationTypes.put("map", "dict"); @@ -139,7 +145,7 @@ public void processOpts() { // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. Map securitySchemeMap = openAPI != null ? - (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; + (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; List authMethods = fromSecurity(securitySchemeMap); if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { supportingFiles.add(new SupportingFile("python-experimental/signing.mustache", packagePath(), "signing.py")); @@ -166,12 +172,12 @@ public void processOpts() { supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); if (!generateSourceCodeOnly) { - supportingFiles.remove(new SupportingFile("setup.mustache", "", "setup.py")); - supportingFiles.add(new SupportingFile("python-experimental/setup.mustache", "", "setup.py")); - supportingFiles.remove(new SupportingFile("requirements.mustache", "", "requirements.txt")); - supportingFiles.add(new SupportingFile("python-experimental/requirements.mustache", "", "requirements.txt")); - supportingFiles.remove(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); - supportingFiles.add(new SupportingFile("python-experimental/test-requirements.mustache", "", "test-requirements.txt")); + supportingFiles.remove(new SupportingFile("setup.mustache", "", "setup.py")); + supportingFiles.add(new SupportingFile("python-experimental/setup.mustache", "", "setup.py")); + supportingFiles.remove(new SupportingFile("requirements.mustache", "", "requirements.txt")); + supportingFiles.add(new SupportingFile("python-experimental/requirements.mustache", "", "requirements.txt")); + supportingFiles.remove(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); + supportingFiles.add(new SupportingFile("python-experimental/test-requirements.mustache", "", "test-requirements.txt")); } // default this to true so the python ModelSimple models will be generated @@ -299,7 +305,7 @@ public String toModelImport(String name) { // name looks like cat.Cat String moduleName = name.split("\\.")[0]; // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html - return "from " + modelPackage() + " import " + moduleName; + return "from " + modelPackage() + " import "+ moduleName; } private String robustImport(String name) { @@ -307,8 +313,8 @@ private String robustImport(String name) { String moduleName = name.split("\\.")[0]; // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html String modelImport = "try:\n from " + modelPackage() + - " import " + moduleName + "\nexcept ImportError:\n " + - moduleName + " = sys.modules[\n '" + modelPackage() + "." + moduleName + "']"; + " import " + moduleName+ "\nexcept ImportError:\n " + + moduleName + " = sys.modules[\n '" + modelPackage() + "." + moduleName + "']"; return modelImport; } @@ -340,9 +346,9 @@ private void fixOperationImports(Set imports) { @Override @SuppressWarnings("static-method") public Map postProcessOperationsWithModels(Map objs, List allModels) { - HashMap val = (HashMap) objs.get("operations"); + HashMap val = (HashMap)objs.get("operations"); ArrayList operations = (ArrayList) val.get("operation"); - ArrayList> imports = (ArrayList>) objs.get("imports"); + ArrayList> imports = (ArrayList>)objs.get("imports"); imports.clear(); for (CodegenOperation operation : operations) { fixOperationImports(operation.imports); @@ -371,7 +377,7 @@ private void fixModelImports(Set imports) { /** * Override with special post-processing for all models. - */ + */ @SuppressWarnings({"static-method", "unchecked"}) public Map postProcessAllModels(Map objs) { // loop through all models and delete ones where type!=object and the model has no validations and enums @@ -714,7 +720,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty p) { public void postProcessParameter(CodegenParameter p) { postProcessPattern(p.pattern, p.vendorExtensions); // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives - if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)) { + if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)){ p.baseType = null; } else if (p.isListContainer && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { // fix ListContainers @@ -722,7 +728,7 @@ public void postProcessParameter(CodegenParameter p) { } } - private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel result) { + private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel result){ // for composed schema models, if the required properties are only from oneOf or anyOf models // give them a nulltype.Null so the user can omit including them in python ComposedSchema cs = (ComposedSchema) schema; @@ -744,7 +750,7 @@ private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel resu if (anyOf != null) { oneOfanyOfSchemas.addAll(anyOf); } - for (Schema sc : oneOfanyOfSchemas) { + for (Schema sc: oneOfanyOfSchemas) { Schema refSchema = ModelUtils.getReferencedSchema(this.openAPI, sc); addProperties(otherProperties, otherRequired, refSchema); } @@ -762,7 +768,7 @@ private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel resu List reqVars = result.getRequiredVars(); if (reqVars != null) { - for (CodegenProperty cp : reqVars) { + for (CodegenProperty cp: reqVars) { String propName = cp.baseName; if (otherRequiredSet.contains(propName) && !selfRequiredSet.contains(propName)) { // if var is in otherRequiredSet and is not in selfRequiredSet and is in result.requiredVars @@ -899,20 +905,20 @@ public String getSimpleTypeDeclaration(Schema schema) { * Primitive types in the OAS specification are implemented in Python using the corresponding * Python primitive types. * Composed types (e.g. allAll, oneOf, anyOf) are represented in Python using list of types. - *

+ * * The caller should set the prefix and suffix arguments to empty string, except when * getTypeString invokes itself recursively. A non-empty prefix/suffix may be specified * to wrap the return value in a python dict, list or tuple. - *

+ * * Examples: * - "bool, date, float" The data must be a bool, date or float. * - "[bool, date]" The data must be an array, and the array items must be a bool or date. - * - * @param p The OAS schema. - * @param prefix prepended to the returned value. - * @param suffix appended to the returned value. + * + * @param p The OAS schema. + * @param prefix prepended to the returned value. + * @param suffix appended to the returned value. * @param referencedModelNames a list of models that are being referenced while generating the types, - * may be used to generate imports. + * may be used to generate imports. * @return a comma-separated string representation of the Python types */ private String getTypeString(Schema p, String prefix, String suffix, List referencedModelNames) { @@ -962,7 +968,7 @@ private String getTypeString(Schema p, String prefix, String suffix, List()); - - Assert.assertEquals(codegenParameter.defaultValue, "-efg"); - } - - @Test - public void testExample1() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); - final PythonClientCodegen codegen = new PythonClientCodegen(); - - Operation operation = openAPI.getPaths().get("/example1/singular").getGet(); - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); - - Assert.assertEquals(codegenParameter.example, "example1 value"); - - Operation operation2 = openAPI.getPaths().get("/example1/plural").getGet(); - CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); - - Assert.assertEquals(codegenParameter2.example, "An example1 value"); - } - - @Test - public void testExample2() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); - final PythonClientCodegen codegen = new PythonClientCodegen(); - - Operation operation = openAPI.getPaths().get("/example2/singular").getGet(); - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); - - Assert.assertEquals(codegenParameter.example, "example2 value"); - } - - @Test - public void testExample3() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); - final PythonClientCodegen codegen = new PythonClientCodegen(); - - Operation operation = openAPI.getPaths().get("/example3/singular").getGet(); - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); - - Assert.assertEquals(codegenParameter.example, "example3: parameter value"); - - Operation operation2 = openAPI.getPaths().get("/example3/plural").getGet(); - CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); - - Assert.assertEquals(codegenParameter2.example, "example3: parameter value"); - } - - @Test - public void testExample4() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); - final PythonClientCodegen codegen = new PythonClientCodegen(); - - Operation operation = openAPI.getPaths().get("/example4/singular").getPost(); - CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter, operation.getRequestBody()); - - Assert.assertEquals(codegenParameter.example, "example4 value"); - - Operation operation2 = openAPI.getPaths().get("/example4/plural").getPost(); - CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegen.setParameterExampleValue(codegenParameter2, operation2.getRequestBody()); - - Assert.assertEquals(codegenParameter2.example, "An example4 value"); + Assert.assertEquals("'Text containing \'single\' quote'", defaultValue); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java index 04424369ea1d..c7988952b7f5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java @@ -31,7 +31,7 @@ public class PythonClientExperimentalTest { @Test(description = "convert a python model with dots") public void modelTest() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/v1beta3.json"); + final OpenAPI openAPI= TestUtils.parseFlattenSpec("src/test/resources/2_0/v1beta3.json"); final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); codegen.setOpenAPI(openAPI); From 58ed6afc0dc51a341cad01420274752b6ec31bff Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Mon, 1 Jun 2020 21:08:50 -0400 Subject: [PATCH 12/12] Update Generate.java (#6515) Removed missed -D messages --- .../src/main/java/org/openapitools/codegen/cmd/Generate.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java index b7f989eeaacd..3387a4047487 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java @@ -230,7 +230,7 @@ public class Generate extends OpenApiGeneratorCommand { @Option(name = {"--log-to-stderr"}, title = "Log to STDERR", description = "write all log messages (not just errors) to STDOUT." - + " Useful for piping the JSON output of debug options (e.g. `-DdebugOperations`) to an external parser directly while testing a generator.") + + " Useful for piping the JSON output of debug options (e.g. `--global-property debugOperations`) to an external parser directly while testing a generator.") private Boolean logToStderr; @Option(name = {"--enable-post-process-file"}, title = "enable post-process file", description = CodegenConstants.ENABLE_POST_PROCESS_FILE_DESC) @@ -407,7 +407,6 @@ public void execute() { } if (globalProperties != null && !globalProperties.isEmpty()) { - System.err.println("[DEPRECATED] -D arguments after 'generate' are application arguments and not Java System Properties, please consider changing to --global-property, apply your system properties to JAVA_OPTS, or move the -D arguments before the jar option."); applyGlobalPropertiesKvpList(globalProperties, configurator); } applyInstantiationTypesKvpList(instantiationTypes, configurator);